Android: battery usage for each application

In any case, to get battery usage information for each application per second in the API, adb shell, ...?

+3
source share
2 answers

Apart from the battery usage screen in the settings, there is no API or command line to get this information.

+4
source

just try reading 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 information shown on the battery usage screen. the key class is IBatteryStats and BatteryStatsImpl.

+2

Source: https://habr.com/ru/post/1795367/


All Articles