Code example for BluetoothDevice

Methods: createRfcommSocketToServiceRecord

0
            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);
            } 
            mmSocket = tmp;
        } 
 
        public void run() { 
        	RhoBluetoothManager.logi(TAG, "BEGIN mConnectThread");
            setName("ConnectThread");
 
            // Always cancel discovery because it will slow down a connection 
            mAdapter.cancelDiscovery();
 
            // Make a connection to the BluetoothSocket 
            try {