per process power consumption in Android

后端 未结 2 1089
南笙
南笙 2020-12-14 13:41

Is there a way to see the power consumption of an Android process? I have a rooted HTC Hero, and I have developed some native programs in C language. I want to see the power

2条回答
  •  失恋的感觉
    2020-12-14 14:25

    As said here: Android Battery usage profiling

    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

提交回复
热议问题