摘要: public void run() { while (true) { if (socket != null) { try { int read = -1; byte buffer[] = new byte[1024]; InputStream inputStream = BluetoothService.socket.getInputStream(); for (; ... 阅读全文
posted @ 2013-07-18 18:35 Shuaiwen8023 阅读(719) 评论(0) 推荐(0) 编辑
摘要: private class ConnectThread extends Thread { private BluetoothSocket mmSocket; private BluetoothDevice mmDevice; ImprovedBluetoothDevice improvedBluetoothDevice; public ConnectThread(BluetoothDevice device) { mmDevice = device; BluetoothSocket tmp = null; improve... 阅读全文
posted @ 2013-07-18 17:05 Shuaiwen8023 阅读(1346) 评论(0) 推荐(0) 编辑
摘要: 这里重点说下蓝牙连接:在做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); }然... 阅读全文
posted @ 2013-07-18 15:50 Shuaiwen8023 阅读(27962) 评论(1) 推荐(1) 编辑