Код: Выделить всё
try {
BluetoothDevice device = btAdapter.getRemoteDevice(bdDevice.toString());
UUID uuid = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
socket = device.createInsecureRfcommSocketToServiceRecord(uuid);
socket.connect();
Toast.makeText(MainActivity.this,"socket bonded", Toast.LENGTH_LONG).show();
} catch(Exception e) {
tv.setText(e.toString());
}
Подробнее здесь: https://stackoverflow.com/questions/341 ... tting-uuid