is Bluetooth Turned On - Android android.bluetooth

Android examples for android.bluetooth:Bluetooth On Off

Description

is Bluetooth Turned On

Demo Code

import android.bluetooth.BluetoothAdapter;

public class Main{

    public static boolean isBluetoothTurnedOn() {
        BluetoothAdapter mBluetoothAdapter = BluetoothAdapter
                .getDefaultAdapter();//from  w  w w .  j  ava 2 s. c o m
        return mBluetoothAdapter != null
                && mBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON;
    }

}

Related Tutorials