Feature for getSystemAvailableFeatures() and hasSystemFeature(String).
The device is capable of communicating with other devices via Bluetooth Low Energy radio.
Constant Value: "android.hardware.bluetooth_le"
Here are some examples of some Bluetooth Low-Energy Android Devices.
1. Get a PackageManager Instance named myPackageManager.
Constant Value: "android.hardware.bluetooth_le"
Here are some examples of some Bluetooth Low-Energy Android Devices.
1. Get a PackageManager Instance named myPackageManager.
2. Create a Boolean Variable named bolBLESupported.
3. Set the Minimum and Target SDK version to 18 or greater.
4. In the onCreate method, add the below code. This will return the Bluetooth Low Energy ability to a boolean named bolBLESupported. It will then display a toast displaying the Bluetooth Low Energy ability of the device to the user.
bolBLESupported = myPackageManager.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE);
if (bolBLESupported) {
Toast.makeText(this, "Device has Bluetooth Low Energy capability", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, "No Bluetooth Low Energy capability!", Toast.LENGTH_LONG).show();
}
5. Compile and run!
Resources:
http://developer.android.com/reference/android/content/pm/PackageManager.html#FEATURE_BLUETOOTH_LE
http://developer.android.com/reference/android/content/pm/PackageManager.html#FEATURE_BLUETOOTH_LE