Android Forum » Android Developer Forum » Android Developer Forum (general) » Blutooth printing and barcode reading
created on Apr 11, 2011 8:51:39 AM
— modified on Apr 13, 2011 12:26:00 PM
I wonder if anyone could please help me with a problem I am having. I am rewriting an app I origionaly developed in J2ME using android. The only thing I am having an issue with is bluetooth. The application reads information from a bluetooth barcode reader and sends data to a bluetooth printer.
Before any data is read or written, I scan for all bluetooth devices, allow the user to select a device and store the devices MAC Address.
Lets start with the barcode reader. Device discovery does not find it. Why? even a Nokia device is able to find the reader I am using.
Discovery finds the printer, but when I try print data to it I get an IOException, unable to start discovery service.
Using J2ME I connected to both devices using: bconn = (StreamConnection) Connector.open("btspp://" + addr + ":1;authenticate=false;encrypt=false;master=false");
With android I am using the following:
private UUID uuidSet;
. . .
System.out.println("open read Error: " + se);
Log.d("0", "Read Error " + se);
The error occurs at the btSocket.connect line
After battling for a few hours I decided to set up my printer and scanner to a PC with a bluesoleil usb bluetooth device.
When I tried the app (using hyperterminal) everything works.
Does anyone have any suggestions please.
Just to add - On the scanning side of things I hardcoded a Scanndy scanners MAC Address into my application.
And I got the data. Downside - After I did this I could not get into settings -> Wireless & Networks.
Why Is Bluetooth so complicated on Android devices?
created on Apr 11, 2011 1:42:43 PM
I've posted your question in the development forums on the German end of our site just to see if anyone knows how to answer it. When we get a response, I'll translate it and post it here.
Thanks for posting!
created on Apr 11, 2011 2:07:20 PM
Thanks, it is really appreciated