So, I have this Android bluetooth project and I am getting a really nasty problem; Let me describe the context:
The two phones that need to be connected are compatible with BluetoothSockets using the exact method described in the Bluetooth documentation on the Android developers site ( here ); Therefore, I use the following streams to connect:
private class AcceptThread extends Thread { private final BluetoothServerSocket mmServerSocket; public AcceptThread() {
This is acceptthread and
private class ConnectThread extends Thread { private final BluetoothSocket mmSocket; private final BluetoothDevice mmDevice; public ConnectThread(BluetoothDevice device) {
i.e. ConnectThread (you may notice that they are really copied from the top link);
The problem is that when you try to connect, the connecting stream does return a socket (calls managesocket ()), but the receiving stream remains in socket = mmServerSocket.accept (), as if nothing would have happened; But something happens in AcceptThread, because when I initiate a connection with another device (with ConnectThread), the locator of the receiving device is updated; Sometimes a connection is actually created correctly, but only after closing a command, disconnecting → turning on bluetoothh, etc.
here is an interesting line in logcat (generated by calling .accept (), I suppose):
07-19 18: 04: 47.484: D / BLZ20_WRAPPER (3143): btlif_signal_event: ### event BTLIF_BTS_RFC_CON_IND does not match ###
So what could be the problem?
ianos source share