Code example for BluetoothSocket

Methods: connect, getInputStream, getOutputStream

0
	} 
	 
	private void connectSocket() throws IOException { 
		try { 
			socket = device.createRfcommSocketToServiceRecord(uuid);			
			socket.connect();
		 
			setInputStream(socket.getInputStream());								
			setOutputStream(socket.getOutputStream());		
		} catch (IOException e) {
			throw e;
		} 
	} 
	 
	public void disconnect() throws IOException { 
		byte[] terminateConnectonSignal = {'\r', '\n', '+', 'B', 'T', 'S', 'T', 'A', 'T', 'E', ':', '1', '\n', '\r'};
		 
		write(terminateConnectonSignal);
		 
		try { 
			if(socket != null)