Code example for BluetoothSocket

Methods: close, connect, getInputStream, getOutputStream

0
		} 
		 
		mBluetoothAdapter.cancelDiscovery();
		 
		try { 
			socket.connect();
		} 
		catch (IOException e) {
			Log.e(TAG,"Unable to connect to requested device", e);
            try { 
                socket.close();
            } catch (IOException e2) {
                Log.e(TAG, "unable to close() socket during connection failure", e2);
            } 
			return false; 
		} 
 
		connected = true;
		 
		try { 
			uavTalk = new UAVTalk(socket.getInputStream(), socket.getOutputStream(), objMngr);
		} catch (IOException e) {
			Log.e(TAG,"Error starting UAVTalk");
			// TODO Auto-generated catch block 
			//e.printStackTrace(); 
			return false;