Code example for BluetoothAdapter: Communicating over Bluetooth

Methods: cancelDiscovery, isDiscovering, startDiscovery

0
	 */ 
	private void doDiscovery(){ 
		if (debug) Log.d(DEBUG_TAG, "Starting discovery, iteration #" + scanningIteration++);
 
        // If we're already discovering, stop it 
        if (mBtAdapter.isDiscovering()) {
            mBtAdapter.cancelDiscovery();
        } 
 
        // Request discover from BluetoothAdapter 
        mBtAdapter.startDiscovery();
	} 
	 
	 
 
	/* 
	 * value in seconds, 0 sets it to constantly discoverable 
	 */ 
	private void setBluetoothDiscoveryDuration(int value){
		if(debug) Log.d(DEBUG_TAG, "Setting discoverability to [" + value + "]");
		Intent discoverableIntent = new