Code example for BluetoothSocket

Methods: connect, getInputStream, getOutputStream

0
	{ 
		 
		UUID uuid = UUID.fromString("00001101-0000-1000-8000-00805f9b34fb"); //Standard SerialPortService ID		
		try { 
			mBSocket = mDevice.createRfcommSocketToServiceRecord(uuid);
			mBSocket.connect();
			mmOutputStream = mBSocket.getOutputStream();
			mmInputStream = mBSocket.getInputStream();
 
			return true; 
 
		} catch (IOException e) {
			Log.e(TAG, e.getMessage());
			return false; 
		}		 
	} 
	 
	public void disconnect() 
	{ 
		try { 
			if (mBSocket != null)