Is there anyway to get the battery usage info per application per second in API, adb shell, ...?
Asked
Active
Viewed 7,192 times
4
-
Any news on this questions? – Alex K Apr 26 '16 at 11:52
-
I also suffer from this problem if you find any solution please help me. – akhil batlawala Nov 18 '16 at 04:36
2 Answers
5
Other than the battery usage screen in Settings, there is no API or command-line way to get this information.

CommonsWare
- 986,068
- 189
- 2,389
- 2,491
-
I want to get the info that the battery usage screen gets. Is it possible to get it using sdk or ndk? Because that is not part of the public API. – Mohammad Moghimi Mar 01 '11 at 01:31
-
-
For anyone coming here from the future, this post may be helpful: https://stackoverflow.com/a/27821415/275524 – AndrewJC Jul 13 '17 at 18:55
-
This answer is not correct, there is a possibility to access that data, GSam Battery Monitor does that and without any root access either. – Sep 10 '21 at 09:49
2
just try to read http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/1.6_r2/com/android/settings/fuelgauge/PowerUsageSummary.java/ , then you can get the info shown in the battery usage screen. the key class are IBatteryStats and BatteryStatsImpl.

iss
- 21
- 1
-
Can you please provide a detailed answer, I am trying for more than a month, but no luck. – S.Ahsan Aug 22 '16 at 18:56