Code example for BluetoothSocket

Methods: connect

0
		@Override 
		public void connect() throws IOException { 
		    if (mmSocket == null) {
    			BluetoothDevice device = mmBluetoothAdapter.getRemoteDevice(mmMac);
    			mmSocket = device.createInsecureRfcommSocketToServiceRecord(mmServiceUuid);
    			mmSocket.connect();
		    } 
		} 
		 
		@Override 
		public InputStream getInputStream() throws IOException {
			return mmSocket.getInputStream();
		} 
		 
		@Override 
		public OutputStream getOutputStream() throws IOException {
			return mmSocket.getOutputStream();
		} 
		 
		@Override 
		public void close() throws IOException {