is Bluetooth Turned On - Android Bluetooth

Android examples for Bluetooth:Turn On bluetooth

Description

is Bluetooth Turned On

Demo Code


//package com.java2s;
import android.bluetooth.BluetoothAdapter;

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

Related Tutorials