Code example for BluetoothSocket

Methods: close

0
            connected(mmSocket, mmDevice);
        } 
 
        public void cancel() { 
            try { 
                mmSocket.close();
            } catch (IOException e) {
                Log.e(TAG, "close() of connect socket failed", e);
            } 
        } 
    } 
 
    /** 
     * This thread runs during a connection with a remote device. 
     * It handles all incoming and outgoing transmissions. 
     */ 
    private class ConnectedThread extends Thread {
        private final BluetoothSocket mmSocket;
        private final InputStream mmInStream;
        private final OutputStream mmOutStream;