I think that something is wrong with your code, there should not be socket = tmp.accept(); Here is what I need to do to connect to the socket server:
BluetoothServerSocket serverSocket = null; BluetoothAdapter bta = BluetoothAdapter.getDefaultAdapter(); try { serverSocket = bta.listenUsingInsecureRfcommWithServiceRecord("BluetoothChatInsecure", UUID.fromString("00001101-0000-1000-8000-00805F9B34FB")); } catch (IOException e) { e.printStackTrace(); } while(!Thread.interrupted()) { try { socket = serverSocket.accept(); if (socket != null) { Log.d("CONNECTED", "Connected bluetooth");
source share