Code example for BluetoothDevice

Methods: createRfcommSocketToServiceRecord

0
			 */ 
			BluetoothDevice device = null;
 
			device = adapter.getRemoteDevice(address);
 
            socket = device.createRfcommSocketToServiceRecord(MY_UUID);
             
            socket.connect();                
            onConnect(); 
             
            return true; 
		} catch(IOException ioe) {
			return false; 
		} catch(InterruptedException ie) {
			throw ie;
		} 
	} 
	protected abstract void onConnect() throws IOException, InterruptedException; 
	 
	protected abstract void read() throws IOException, InterruptedException;