BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 07-15-2008, 02:11 PM   #1
EmilieL
Thumbs Must Hurt
 
Join Date: Apr 2008
Model: 7100T
PIN: N/A
Carrier: idk
Posts: 84
Default Bluetooth adapter programming

Please Login to Remove!

Hi everyone!
I'm running some tests on a bluetooth adapter for printers.
It works fine when I print from the PC but I'd like to print with my BlackBerry...

So I created a small application which :
-Retrieves the paired devices
-Retrieves the services available for the device
-Connects to the selected service

I am able to retrieve the devices and the services.
There is only one service available for the adapter :
Bluetooth Serial Port
great!

Now I want to send data to the printer...
Code:
String URL = _service.getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT,false);
            
            StreamConnection connection=null;
            try
            {
                 connection= (StreamConnection) Connector.open(URL);
            }
            catch(IOException io)
            {
            }
            
                try
                {
                    byte[] buffer  = new byte[100];
                    String msg = "hello there";
                    InputStream din = connection.openInputStream();
                    OutputStream dout = connection.openOutputStream();
                    
                    dout.write(msg.getBytes());
                    dout.flush();
                    
                    din.read(buffer);
                    dout.close();
                    din.close();
                    connection.close();
                }
                catch(IOException ie)
                {
                }
        }
I am able to get the URL but nothing happens when I call Connector.open(URL)
It doesn't crash or anything...
it just freezes there.

Any help?
(PS : I know that the printer won't understand "Hello There" ;) It's just a test)
__________________
Stop telling me what it can do...
Show me how to make it do it!!!!
Offline  
Old 07-16-2008, 01:19 PM   #2
MBW
Talking BlackBerry Encyclopedia
 
MBW's Avatar
 
Join Date: May 2008
Model: 8110
PIN: N/A
Carrier: AT&T
Posts: 393
Default

I don't know enough about the API to comment directly, but I do know that without a parlay of elements (O/S, service & transport, to oversimplify) all hitting the right versions, the handset doesn't have HTML to rasterize.

I know of only one BT printer at the moment that has a BB driver, and it's limited by this; they're working on it and will have full BB drivers in (wild guess) 6-8 weeks.

I'm a reporter/reviewer - if you're prepping a BT printer for BB, send me a private message and I'd like to arrange to review it.

If your boss's name is Doug, I already have it.
__________________
/\/\\/\/
Offline  
Old 07-19-2008, 06:43 AM   #3
MobileDeveloper
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 8100
PIN: N/A
Carrier: Vodafone
Posts: 134
Default

Does anyone know how to connect a BlackBerry device to all the nearby accesible BlueTooth Handsets and then exchange data ?

Is it possible to have automatic Bluetooth pairing ?
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Mitsubishi Control Board DM00N649.  SM76A127G02 . Ductless unit 47-0910KR (C64) picture

Mitsubishi Control Board DM00N649. SM76A127G02 . Ductless unit 47-0910KR (C64)

$120.00



Jelenko Commodore LS VPF with Pump  picture

Jelenko Commodore LS VPF with Pump

$875.00



3D MULTIMEDIA VIDEO CARD C64/V2 1MB picture

3D MULTIMEDIA VIDEO CARD C64/V2 1MB

$94.05



Vintage Printer Switch box Commodore 64/Sanyo Mountable Computer PC picture

Vintage Printer Switch box Commodore 64/Sanyo Mountable Computer PC

$49.00



Windsor Commodore Fastraction Carpet Cleaner CMD picture

Windsor Commodore Fastraction Carpet Cleaner CMD

$1995.00



Vintage Commodore Green Line Computer Calculator Custom GL-997R Made In The UK  picture

Vintage Commodore Green Line Computer Calculator Custom GL-997R Made In The UK

$27.99







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.