How does Android measure energy used by individual hardware component? How does Android measure energy used by each individual process?

  • I guess how many instructions are performed in 1 sec.
    – AZ_
    Mar 1, 2012 at 9:25
  • 7
    @Algo: It will be totally misleading to assume a background application that uses a lot of CPU is more battery hungry than another application that uses little CPU but a lot of Wifi and GPS and display.
    – Lie Ryan
    Mar 1, 2012 at 10:11
  • If so then you can get hint from the number of permissions that an application acquired.. just an idea.
    – AZ_
    Mar 2, 2012 at 7:49
  • @LieRyan in the battery stats, isn't wifi, gps, bluetooth, etc, calculated as their own "consumer" of the battery? Mar 2, 2012 at 15:53

1 Answer 1


Android tracks events that affect battery usage and stores this information in batterystats.bin file. Some examples:

  • length of time screen was on with a specific brithness setting
  • which application (or non Android app process) and how long held a wake lock (prevents device from sleeping)
  • CPU usage per process (Android app or other process)
  • phone signal strength
  • GPS usage
  • etc.

Android computes how much power each Application or component (e.g. screen) uses based on configuration information included on the device by the manufacturer.

Not everything is measured so the statistics can be sometimes misleading, but it gets better with every Android Platform release.

Battery statistics can be dumped from the device using:

adb shell dumpsys batterystats

Here is interesting fragment of a post by Diane Hackborn with more details about wake locks power consumption:

There are two ways power from wake locks is computed.

  1. On some chipsets, simply holding a wake lock needs to prevent the CPU from going to a full deep sleep. In the reported battery usage, this extra power use will be distributed across all apps holding wake locks.

  2. Even if the wake lock itself doesn't cause power use, holding a wake lock in one app can allow other applications to run and CPU when they wouldn't otherwise. (For example, some app may have a { sleep(1); do something; } loop that wouldn't run if no wake locks are held.) To address this, half of the CPU usage of applications is distributed to be blamed on the ones holding wake locks.

  • can you provide sources/reference that proof your answer ?
    – diimdeep
    Mar 10, 2012 at 5:19
  • All information is from the provided link to google+ thread by Google developer familiar with this area. Mar 10, 2012 at 13:26
  • 1
    The correct command for new devices (not sure from which API) should be : adb shell dumpsys batterystats , or (in case you want it inside a file) : adb shell dumpsys batterystats > batterystats.txt Aug 29, 2014 at 14:37

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .