cheng81 / Android-Bluetooth-Simulator

Simple tcp-based bluetooth simulator for the android emulator
47 stars 5 forks source link

Connecting to other Bluetooth device #6

Open mohamad-abuzaid opened 13 years ago

mohamad-abuzaid commented 13 years ago

So now I can enable bluetooth on bothdevices and perform discovery. And I could find other device.... But when I connect to the other device the bluetoothsocket always returns null after calling the RFcomm function:

socket = createRFComm...(UUID);

saying service is not available

cheng81 commented 13 years ago

is this still in the emulator application? could you provide the output of the server? couldn't be that you are not starting the server on the device? the "workflow" is that: 1) start the app in both emulators 2) enable bt on both emulators 3) start the server in one of the emulators 4) on the other, perform discovery and start the client on the found device

hope that this helps!

mohamad-abuzaid commented 13 years ago

Ok....I followed your workflow...and this the error that shows

My code is as follow: mmSocket = device.createRfcommSocketToServiceRecord(UUID.fromString(myUUID));

Error message is: mmSocket: null Error:Java.io.IOException: sdp service discovery failed: service not found