Code example for BluetoothSocket

Methods: connect

0
		mAdapter = BluetoothAdapter.getDefaultAdapter();
		BluetoothDevice device = mAdapter.getRemoteDevice(address);
		try { 
			mSocket = device
					.createInsecureRfcommSocketToServiceRecord(MY_UUID_INSECURE);
			mSocket.connect();
		} catch (IOException e) {
		} 
	} 
 
	@Override 
	public InputStream getInputStream() throws IOException {
		return mSocket.getInputStream();
	} 
 
	@Override 
	public OutputStream getOutputStream() throws IOException {
		return mSocket.getOutputStream();
	} 
 
	@Override