Code example for BluetoothDevice

Methods: createRfcommSocketToServiceRecord

0
        // given BluetoothDevice 
        try { 
        	//Method m = device.getClass().getMethod("createInsecureRfcommSocket", new Class[] {int.class}); 
        	//tmp = (BluetoothSocket) m.invoke(device, 1); 
 
            tmp = device.createRfcommSocketToServiceRecord(UUID.fromString("00001101-0000-1000-8000-00805F9B34FB"));
        } catch (Exception e) {
            Log.e(TAG, "create() failed", e);
        } 
        mmSocket = tmp;
    } 
 
    public void run() { 
        Log.i(TAG, "BEGIN mConnectThread");
        setName("ConnectThread");
 
        // Always cancel discovery because it will slow down a connection 
        mAdapter.cancelDiscovery();
 
        // Make a connection to the BluetoothSocket 
        try {