is Bluetooth Had Open - Android Bluetooth

Android examples for Bluetooth:Turn On bluetooth

Description

is Bluetooth Had Open

Demo Code


//package com.java2s;

import android.bluetooth.BluetoothAdapter;

public class Main {

    public static boolean isBluetoothHadOpen() {
        if (isThisMahionSupportBluetooth()) {
            BluetoothAdapter ba = BluetoothAdapter.getDefaultAdapter();
            if (ba.isEnabled()) {
                return true;
            }//from   www  .  ja v a2s  . c  o  m
        }
        return false;
    }

    public static boolean isThisMahionSupportBluetooth() {
        BluetoothAdapter ba = BluetoothAdapter.getDefaultAdapter();
        if (null != ba) {
            return true;
        }
        return false;
    }
}

Related Tutorials