Android的电池使用情况分析 [英] Android Battery usage profiling
问题描述
有什么办法来分析在开发环境或实时应用的电池使用? BatteryManager 似乎没有提供任何每个应用程序的API
Is there any way to profile the battery usage by the application in development environment or real time? BatteryManager seems not providing any per application API
推荐答案
我不认为这是可能的时刻。
I don't think that is possible at the moment.
有一个私人API,PowerProfile,检索一个子系统级电池消耗(见<一href="http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android/2.2_r1.1/com/android/internal/os/PowerProfile.java">http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android/2.2_r1.1/com/android/internal/os/PowerProfile.java).另外看看在code的燃油表你发现Android的设置上,他们是如何计算功耗:<一href="http://google.com/$c$csearch/p?hl=en#ohAXAHj6Njg/src/com/android/settings/fuelgauge/PowerUsageSummary.java">http://google.com/$c$csearch/p?hl=en#ohAXAHj6Njg/src/com/android/settings/fuelgauge/PowerUsageSummary.java
There is a private API, PowerProfile, for retrieving battery consumption on a subsystem level (see http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/com/android/internal/os/PowerProfile.java). Also take a look at the code for the fuel gauge you find in Android's settings on how they calculate power consumption: http://google.com/codesearch/p?hl=en#ohAXAHj6Njg/src/com/android/settings/fuelgauge/PowerUsageSummary.java
这篇关于Android的电池使用情况分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!