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

  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!

  2. 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 :)

  3. Spook Murphy on said:

    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.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Set your Twitter account name in your settings to use the TwitterBar Section.