@ TargetApi ( 18 ) public boolean checkAvailability ( ) throws BleNotAvailableException { if ( ! isBleAvailableOrSimulated ( ) ) { throw new BleNotAvailableException ( "Bluetooth LE not supported by this device" ) ; } return ( ( BluetoothManager ) mContext . getSystemService ( Context . BLUETOOTH_SERVICE ) ) . getAdapter ( ) . isEnabled ( ) ; }
Check if Bluetooth LE is supported by this Android device and if so make sure it is enabled .