Bluetooth Battery Level API getBatteryLevel() is not working in Android 8.1.0

1.5k Views Asked by At

I am trying to get the Battery Level from BluetoothDevice in Android 8.1.0 of remotely connected BT device.

BluetoothDevice mBTDevice = (BluetoothDevice) bundle
                        .getParcelable(BluetoothDevice.EXTRA_DEVICE);
int val = mBtDevice.getBatteryLevel();

But its val always returning value as "-1" . It seems not working in Android 8.1.0

Got the info from this link

0

There are 0 best solutions below