I am trying to connect my Android phone to my Nokia phone. I can discover the Nokia phone through my Andorid application. I can create the socket successfully:
btSocket = device.createRfcommSocketToServiceRecord(MY_UUID);
But when I try to connect to the nokia phone there is an error in connection. I am trying to run this sample provided in the link below:
And an error is occured when the code btSocket.connect()
which is present in the onResume()
method is executed:
Logcat:
D/BluetoothAdapter( 176): checkBluetoothAddress
E/THINBTCLIENT( 4738): ON RESUME: Exception during connect.
E/THINBTCLIENT( 4738): java.io.IOException: Service discovery failed
E/THINBTCLIENT( 4738): at android.bluetooth.BluetoothSocket$SdpHelper.doSdp(BluetoothSocket.java:377)
E/THINBTCLIENT( 4738): at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:201)<br>
E/THINBTCLIENT( 4738): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1149)
And this is the UUID
I am using:
private static final UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");`
Kindly let me know where I am going wrong. I tried to look for help in Stackoverflow and on the internet in general, but no help was found.