摘要:
public void run() { while (true) { if (socket != null) { try { int read = -1; byte buffer[] = new byte[1024]; InputStream inputStream = BluetoothService.socket.getInputStream(); for (; ... 阅读全文
摘要:
private class ConnectThread extends Thread { private BluetoothSocket mmSocket; private BluetoothDevice mmDevice; ImprovedBluetoothDevice improvedBluetoothDevice; public ConnectThread(BluetoothDevice device) { mmDevice = device; BluetoothSocket tmp = null; improve... 阅读全文
摘要:
这里重点说下蓝牙连接:在做android蓝牙串口连接的时候一般会使用 BluetoothSocket tmp = null; // Get a BluetoothSocket for a connection with the // given BluetoothDevice try { tmp = device.createRfcommSocketToServiceRecord(MY_UUID); } catch (IOException e) { Log.e(TAG, "create() failed", e); }然... 阅读全文