is Bluetooth device Discoverable - Android Bluetooth

Android examples for Bluetooth:Bluetooth Device

Description

is Bluetooth device Discoverable

Demo Code


//package com.java2s;

import android.bluetooth.BluetoothAdapter;

public class Main {
    public static boolean isDiscoverable() {
        BluetoothAdapter bluetoothDefaultAdapter = BluetoothAdapter
                .getDefaultAdapter();/*from   w ww  . j a va2s.c o m*/
        if ((bluetoothDefaultAdapter != null)
                && (bluetoothDefaultAdapter.isEnabled())) {
            if (bluetoothDefaultAdapter.getScanMode() == BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE)
                return true;
        }
        return false;
    }
}

Related Tutorials