Android Bluetooth Send Message Working First Time Only
I need to send string message from Raspberry PI to Android device. I am getting message first time only. After that it does not work at all. I am using PYTHON code in Raspberry PI.
Solution 1:
We just need to add some code into manageConnectedSocket block. Basically we need to cancel the acceptThread if not null and restart the service:
private void manageConnectedSocket(BluetoothSocket socket) {
Log.i(TAG, "Hurray!! I am here");
//
if (acceptThread != null) {
acceptThread.cancel();
acceptThread = null;
}
//
if (acceptThread == null) {
acceptThread = new AcceptThread();
acceptThread.start();
}
}
Post a Comment for "Android Bluetooth Send Message Working First Time Only"