Код: Выделить всё
public void connectBluetooth() throws IOException{
device = bluetoothAdapter.getRemoteDevice(MAC);
try {
mSocket = device.createRfcommSocketToServiceRecord(MY_UUID);
} catch (IOException e) {
Log.e(tag, "+++++Failed to create RFCOMM connection+++++");
}
try{
mSocket.connect();
Log.e(tag, "+++++connecting+++++");
manageBluetooth manageThread = new manageBluetooth();
manageThread.start();
threadCheck = true;
}catch(IOException e){
Log.e(tag, "+++++Failed to connect+++++");
}
Log.e(tag, "+++++After catch+++++");
}
}
Конечно, он должен просить меня ввести PIN-код на моем телефоне, а не на встроенной плате.
Подробнее здесь: https://stackoverflow.com/questions/840 ... -bluetooth