Android-Bluetooth-Simulator icon indicating copy to clipboard operation
Android-Bluetooth-Simulator copied to clipboard

Connecting to other Bluetooth device

Open mohamad-abuzaid opened this issue 14 years ago • 2 comments

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

mohamad-abuzaid avatar Jul 28 '11 15:07 mohamad-abuzaid

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!

cheng81 avatar Jul 28 '11 15:07 cheng81

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

mohamad-abuzaid avatar Jul 29 '11 00:07 mohamad-abuzaid