per process power consumption in Android

牧云@^-^@ 提交于 2019-11-27 13:20:06

问题


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 consumptions of these programs. So, I want a way to measure the power consumption in process level and not in application level as e.g. PowerTutor application does..

Is there an API that can help me develop an application that can do this thing? Can I use /proc/ stats etc.?

any ideas on this?


回答1:


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




回答2:


AppScope is an application energy metering framework for Android smartphones using kernel activity monitoring. AppScope provides an accurate and detailed both per-application and per-process energy estimation solution.

The current release supports HTC Nexus One only and can be found here.

For more information and technical details about the AppScope framework you can read the AppScope paper presented at USENIX ATC '12, here.



来源:https://stackoverflow.com/questions/6051807/per-process-power-consumption-in-android

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