Code example for BluetoothAdapter

Methods: listenUsingRfcommWithServiceRecord

0
            mSocketType = secure ? "Secure" : "Insecure";
 
            Util.debug("Accept thread starting."); 
            // Create a new listening server socket 
            try { 
                tmp = mAdapter.listenUsingRfcommWithServiceRecord(NAME_SECURE, MY_UUID_SECURE);
            } catch (IOException e) {
                Log.e(TAG, "Socket Type: " + mSocketType + "listen() failed", e);
            } 
            mmServerSocket = tmp;
        } 
 
        public void run() { 
            if (D) {
                Log.d(TAG, "Socket Type: " + mSocketType +
                        "BEGIN mAcceptThread" + this);
            } 
            setName("AcceptThread" + mSocketType);
 
            BluetoothSocket socket = null;