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?