Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Battery Profiling. Calculate Battery Cycle

I am developing a Battery profiling app and I am stuck at calculating total Battery Cycle for the device. Does anyone have idea about how to get this value either in API way or from adb command ? Or is there any hack possible ? Any help would be appreciated.

Thanks in advance.

like image 930
snehal_penurkar Avatar asked Feb 04 '26 23:02

snehal_penurkar


1 Answers

The power consumption APIs turned into private since Android 4.0.2. There are two ways to implement this. One is using reflection method. Another is to program in source code environment. Here's a reference telling you how to use source code programming.

https://github.com/anggrayudi/android-hidden-api

like image 110
Xudong Ran Avatar answered Feb 06 '26 13:02

Xudong Ran



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!