Is it possible to programmatically retrieve the battery serial number on Android ?
I had a look at system properties, but I can't find anything related to battery there.
As Android runs on Linux you might get this information from the /proc
and/or /sys
directories. For example on some devices you can get the serial number by calling
cat /sys/class/power_supply/battery/serial_number
As this is device-dependent it might work or not work for your device. As you can see from this code the actual location of the battery information is usually different on each system, so this approach will only work if you know the location of this data on each of the device you want to support
Also note that accessing this information from user apps might be blocked in more recent Android versions, and you'll need a rooted phone to get it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With