Code example for BluetoothSocket

Methods: getInputStreamgetOutputStream

0
	public BluetoothSocketConnection(final BluetoothDevice pBluetoothDevice, final String pUUID) throws IOException, BluetoothException {
		this(pBluetoothDevice.createRfcommSocketToServiceRecord(UUID.fromString(pUUID)));
	} 
 
	public BluetoothSocketConnection(final BluetoothSocket pBluetoothSocket) throws IOException, BluetoothException {
		super(new DataInputStream(pBluetoothSocket.getInputStream()), new DataOutputStream(pBluetoothSocket.getOutputStream()));
 
		this.mBluetoothSocket = pBluetoothSocket;
		 
		if(Bluetooth.isSupportedByAndroidVersion() == false) { 
			throw new BluetoothException(); 
		} 
	} 
 
	// =========================================================== 
	// Getter & Setter 
	// =========================================================== 
 
	public BluetoothSocket getBluetoothSocket() {
		return this.mBluetoothSocket;
	}