Android: Battery usage of each application

不羁的心 提交于 2019-12-29 00:59:28

问题


Is there anyway to get the battery usage info per application per second in API, adb shell, ...?


回答1:


Other than the battery usage screen in Settings, there is no API or command-line way to get this information.




回答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.



来源:https://stackoverflow.com/questions/5149121/android-battery-usage-of-each-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!