Power Tutor–Android App Measures Power Consumption of App
Mobile computing and smart phones cannot be what we see today without powerful and energy efficient batteries. Mobile application developers, however, don’t get used to think of building energy efficient apps. Sometimes, it can affect the application a lot.
I recently found a tool, Power Tutor, that runs on Android devices to measure the power performance of the device. This post is about how Power Tutor works and how it can help to develop Android apps. It doesn’t cover every detail of the theory (one can refer to the research paper in reference 1 if interested.), but briefly describes how it works in general.
Component-Based Measurement
Power Tutor measures the energy consumption by components, including CPU, WIFI, 3G, Display etc. Each component has different states, and the power consumption rate at each state differ. Power Tutor includes a set of parameters for each state describing how fast power is consumed at the state. The parameters are obtained by their developers from offline experiments. Use these parameters, they construct a power measurement model to measure the energy. Below are screenshots of Power Tutor measurement for a Android phone.
Figure 1. Power Measurement for Android Phone
The parameters they use in current app is obtained from several HTC phones, so it works best for those models (refer to reference 1 for model details). The method Power Tutor developers/researchers proposed is able to obtain the parameters on other phones, but the app doesn’t provide such a function.
Power Consumption for Each App
Power Tutor has a “Application Viewer” function to view the power consumption for each app.
On Android, each app/process is considered as a separate user with its own UID. Under /proc/uid_stat/<UID>/ directory, lots of information are available about the app/process, including data transmitted, memory usage etc. Power Tutor map process id to UID, then based on the stats found under the <UID> folder to decide the states for each component. Then based on the power measurement model, Power Tutor computes the energy consumption.
Power Tutor thinks the energy consumption of each app is independent. In other words, Power Tutor assumes app A consumes the same amount of energy with or without app B running. In this way, based on statistics for each component for each UID/app, Power Tutor obtained the power consumption for each UID/app. Then summing them up to get the power consumption for the entire system.
If your app is running as super user program, the Android system assigns a UID of 0 to it. In this case, it breaks the Android rule of “each app is treated as a separate user”. Power Tutor shows UID 0 as “kernel” process.
Below are a screenshot of the stats for all running apps and a screenshot of the video converter app power consumption,
Figure 2. App-Based Power Measurement
How to Use it to Help Development
First of all, it can used to measure the power performance of your app. Because Power Tutor breaks down the power consumption to components, you can also get an idea what kind of activity is consuming the battery in your app. Is it network communication through WiFi? or too much CPU consumption?
Also Power Tutor measures the power based on statistics obtained from the /proc and /sys directories. It indirectly reflects the usage of hardware components. Is your app CPU bound, if your app is constantly consumes a lot of CPU component power? I give an example in another post here.
References:
1. Power Tutor website: http://powertutor.org/
4 comments on “Power Tutor–Android App Measures Power Consumption of App”
Leave a Reply Cancel reply
40% Discount on My Book — Android NDK Cookbook
Android NDK Cookbook ebook 40% discount with promotion code MREANC40 at Packt Publishing The promotion code is valid until 15th June.Categories
- Android Apps (18)
- Android Audio Editor (1)
- TS 2 (3)
- Video Converter Android (8)
- Video2Gif (1)
- Android Tutorial (27)
- Android Dev Tools (1)
- API illustrated (8)
- Multimedia API (3)
- ffmpeg on Android (4)
- NDK (6)
- UI (6)
- Animation (2)
- Code Snippet (2)
- Coding Beyond Technique (18)
- a word, a world (4)
- Bug Rectified (4)
- Programming Habit (1)
- Software as a Career (1)
- Software as User Experience (1)
- Compilers and Related (2)
- ELF (2)
- Computer Languages (31)
- C/C++ (13)
- Java (9)
- JavaScript (2)
- PHP (1)
- Python (8)
- Data Structure & Algorithms (29)
- Bits (1)
- Data Structure (5)
- Integers (10)
- BigInteger (1)
- Prime (4)
- Search (3)
- Sorting (5)
- Strings (5)
- Database (1)
- SQLite (1)
- Digital Signal Processing (33)
- Distributed Systems (17)
- Apache Cassandra (6)
- Apache Hadoop (8)
- Apache Avro (3)
- Apache Nutch (3)
- Apache Solr (1)
- Linux Study Notes (40)
- crontab (1)
- Linux Kernel Programming (8)
- Linux Programming (12)
- IPC (2)
- Linux Network Programming (5)
- Linux Signals (2)
- Linux Shell Scripting (1)
- ssh (3)
- Machinery (30)
- misc (1)
- My Ideas (1)
- My Project (3)
- Mobile Caching (1)
- Selective Decoding (2)
- My Publication (1)
- My Readings (1)
- Networking (15)
- Program for Performance (8)
- Uncategorized (1)
- Virtual Machine (2)
- Web Dev (8)
- web components (3)
- Android Apps (18)
Recent Comments
Archives
- May 2013 (2)
- April 2013 (1)
- March 2013 (4)
- December 2012 (2)
- November 2012 (6)
- October 2012 (6)
- September 2012 (3)
- August 2012 (13)
- July 2012 (15)
- June 2012 (3)
- May 2012 (8)
- April 2012 (4)
- March 2012 (13)
- February 2012 (19)
- January 2012 (9)
- December 2011 (11)
- November 2011 (12)
- October 2011 (4)
- September 2011 (12)
- August 2011 (16)
- July 2011 (15)
- June 2011 (6)
- May 2011 (10)
- April 2011 (13)
- March 2011 (20)
- February 2011 (4)
- November 2010 (2)
- May 2010 (1)
- April 2010 (1)
- February 2010 (1)





Howdy, I think your blog could possibly be having internet browser compatibility issues.
Whenever I look at your web site in Safari, it looks fine but when opening in I.
E., it has some overlapping issues. I merely wanted to give you
a quick heads up! Aside from that, fantastic blog!
Your component based part shows energy consumed by CPU, WIFI, 3G, Display etc. I was wondering if it is possible to use this app to measure the rampup/energy surge of these hardware components ?
Please advise asap
You can go the app page and check it out.
I just recently found this app after dealing with some app that is 10 times larger and gives me useless battery wakelock info that a lot of people swoon over. PowerTutor is accurate and yields actionable information. There are only so many charge cycles in a battery’s life. Developers and regular droid users benefit from PowerTutor.