Whether Bluetooth LE is supported on the device. - Android Bluetooth

Android examples for Bluetooth:Bluetooth Device

Description

Whether Bluetooth LE is supported on the device.

Demo Code

import static android.content.pm.PackageManager.FEATURE_BLUETOOTH_LE;

import android.content.Context;
import android.os.Build;

public class Main {
  /**/*from  w  ww .  j  av a 2 s.  c om*/
   * Whether BLE is supported on the device.
   */
  public static boolean isLeAvailable(Context context) {
    return Build.VERSION.SDK_INT >= 18 // 18, 4.3, JELLY_BEAN_MR2
        && context.getPackageManager().hasSystemFeature(FEATURE_BLUETOOTH_LE);
  }
}

Related Tutorials