user3782779 user3782779 - 3 months ago 47
Android Question

Check the battery level of AltBeacon beacon

I have Radius Network, RadBeacon Dot beacon. It has AltBeacon standard.

I'm developing an Android app, and I need to monitor beacon battery level programmatically from my app.

If I use android-beacon-library I can get the battery level?

If not possible, is there any other way to get the battery level of beacon programmatically from my app?

Answer

Yes, you can get the battery level using the Android Beacon Library like this:

long batteryLevelPercent = beacon.getDataFields().get(0);

Note that this simply fetches the data field of the AltBeacon standard, which on Radius Networks beacons is used for the battery level. This may not work with beacons manufactured by other vendors.