How to check if bluetooth is enabled programmatically?

There you go:

BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (mBluetoothAdapter == null) {
    // Device does not support Bluetooth
} else if (!mBluetoothAdapter.isEnabled()) {
    // Bluetooth is not enabled :)
} else {
    // Bluetooth is enabled 
}

With uses-permission

 <uses-permission android:name="android.permission.BLUETOOTH" android:required="false" />

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)