Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
465 views
in Technique[技术] by (71.8m points)

per process power consumption in Android

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.8k users

...