Code example for BluetoothAdapter

Methods: cancelDiscoverylistenUsingRfcommWithServiceRecord

		} else if (mMethod == BLUETOOTH) {
			mBTSocket = null;
			// TODO check that 
			// Always cancel discovery because it will slow down a connection 
			if (mAction == CONNECT) {
				mBTSocket = mBTDevice
				// Make a connection to the BluetoothSocket 
				// This is a blocking call and will only return on a 
				// successful connection or an exception 
				mInStream = mBTSocket.getInputStream();
				mOutStream = mBTSocket.getOutputStream();
			} else if (mAction == LISTEN) {
				// TODO First param seems useless ?? 
				// Create a new listening server socket 
				BluetoothServerSocket tmp = mBTAdapter
						.listenUsingRfcommWithServiceRecord("KTBDemo", MY_UUID);
				// TODO Global Variable for TIMEOUT 
				mBTSocket = tmp.accept(20000);
				mInStream = mBTSocket.getInputStream();
Connect your IDE to all the code out there  Get Codota for Java