[Android Q&A, Help & Troubleshooting] oneitusatu:
I was able to easily connect/disconnect and receive from my bluetooth remote device with my android phone running ICS (4.0.4).

Recently, somehow, my app doesn't work anymore.

There's no error, just no data is sent or received, because there's no socket created in connection.

My first guess is my hardware, but it's not.

I tried my basic bluetooth connection apps and they won't work neither.

Here is the logcat :

01-05 22:04:42.576: D/bluetooth2(5316): ...Connecting...
01-05 22:04:42.576: I/BluetoothSocket_MTK(5316): [JSR82] connect: do SDP
01-05 22:04:42.577: I/BluetoothSocket_MTK(5316): [JSR82] close
01-05 22:04:42.577: I/BluetoothSocket_MTK(5316): [JSR82] readLock got.
01-05 22:04:42.577: I/BluetoothSocket_MTK(5316): [JSR82] Start to aquire writeLock.
01-05 22:04:42.577: I/BluetoothSocket_MTK(5316): [JSR82] writeLock got.
01-05 22:04:42.578: D/bluetooth2(5316): ...Create Socket...
01-05 22:04:42.584: D/dalvikvm(5316): threadid=14: interp stack at 0x4d1b5000
01-05 22:04:42.587: D/dalvikvm(5316): threadid=14 (Thread-371): calling run()
01-05 22:04:42.594: D/Buffer read(5316): ...[B@417c0930
01-05 22:04:42.594: D/dalvikvm(5316): threadid=14: exiting
01-05 22:04:42.594: D/dalvikvm(5316): threadid=14: bye!
01-05 22:04:42.594: D/dalvikvm(5316): threadid=0: freeing
01-05 22:04:43.135: I/BluetoothSocket_MTK(5316): [JSR82] SdpHelper::onRfcommChannelFound: channel=-1
01-05 22:04:43.135: I/BluetoothSocket_MTK(5316): [JSR82] close
01-05 22:04:43.135: I/BluetoothSocket_MTK(5316): [JSR82] readLock got.
01-05 22:04:43.135: D/bluetooth2(5316): ...Create Socket...
01-05 22:04:43.138: D/dalvikvm(5316): threadid=14: interp stack at 0x4d1b5000
01-05 22:04:43.138: D/dalvikvm(5316): threadid=14 (Thread-372): calling run()
01-05 22:04:43.138: D/Buffer read(5316): ...[B@417c0ec0
01-05 22:04:43.138: D/dalvikvm(5316): threadid=14: exiting
01-05 22:04:43.138: D/dalvikvm(5316): threadid=14: bye!
01-05 22:04:43.138: D/dalvikvm(5316): threadid=0: freeing
01-05 22:04:43.149: I/BluetoothSocket_MTK(5316): [JSR82] close
01-05 22:04:43.149: I/BluetoothSocket_MTK(5316): [JSR82] readLock got.
01-05 22:04:46.149: I/BluetoothSocket_MTK(5316): [JSR82] Bluetooth Socket Constructor
01-05 22:04:46.150: I/BluetoothSocket_MTK(5316): [JSR82] type=1 fd=-1 auth=false encrypt=false port=-1

I use this UUID

// SPP UUID service
private static final UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");

My snippet bluetooth connection

private BluetoothSocket createBluetoothSocket(BluetoothDevice device) throws IOException {
if(Build.VERSION.SDK_INT >= 10){
try {
final Method m = device.getClass().getMethod("createInsecureRfcommSocketToServiceRecord", new Class[] { UUID.class });
return (BluetoothSocket) m.invoke(device, MY_UUID);
} catch (Exception e) {
Log.e(TAG, "Could not create Insecure RFComm Connection",e);
}
}
return device.createRfcommSocketToServiceRecord(MY_UUID);
}

public void bluetoothDisconnect(){
try {
btSocket.close();
} catch (IOException e2) {
errorExit("Fatal Error", "In onPause() and failed to close socket." + e2.getMessage() + ".");
}
}

public void bluetoothConnect(){
BluetoothDevice device = btAdapter.getRemoteDevice(address);
try {
btSocket = createBluetoothSocket(device);
} catch (IOException e) {
errorExit("Fatal Error", "In onResume() and socket create failed: " + e.getMessage() + ".");
}
btAdapter.cancelDiscovery();
Log.d(TAG, "...Connecting...");
try {
btSocket.connect();
Log.d(TAG, "....Connection ok...");
} catch (IOException e) {
try {
btSocket.close();
} catch (IOException e2) {
errorExit("Fatal Error", "In onResume() and unable to close socket during connection failure" + e2.getMessage() + ".");
}
}

// Create a data stream so we can talk to server.
Log.d(TAG, "...Create Socket...");
mConnectedThread = new ConnectedThread(btSocket);
mConnectedThread.start();
}

I guess there's no socket created, but I don't know why. It was fine before for a month.

Some people also have this similar issue. I have tried several solution there but zero result.

Any idea would be appreciate