Code example for BluetoothSocket

Methods: connect, getInputStream, getOutputStream

0
		device = object;
 
		// Connection Attempt 
		try { 
			socket = device.createRfcommSocketToServiceRecord(uuid);
			socket.connect();
			outStream = socket.getOutputStream();
			inStream = socket.getInputStream();
		} catch (IOException e) {
			throw new Exception("Error establishing connection.");
		} 
 
	} 
 
	/** 
	 * Get the Bluetooth input stream. Use this to receive information from the 
	 * remote Bluetooth device. 
	 *  
	 * @return The input stream as an InputStream object. 
	 */ 
	public InputStream getInputStream() {