Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate power consumption of android app?

Whether there is any formula ,Api or method for it? I want to test the power consumption of different apps.

like image 835
wade Lee Avatar asked Apr 09 '12 13:04

wade Lee


People also ask

How do I see how much power an app is using Android?

For Android apps, Android Studio has a built-in energy profiler. This profiler estimates the energy consumption of the CPU, the network radio, and GPS sensors as well as showing the occurrence of different system events that may affect energy consumption.

How do I check battery consumption of an app?

1. There is a simple way to analyse and measure battery usage on mobile devices. go for device settings, and tap battery, it displays the battery usage of the each and every app that you have installed.

How do you calculate power utilization?

To calculate power consumption of any appliance, you have to multiply it's wattage by the number of hours it is being used (operational hours). For example, a 1000 watt electric iron running for one hour will consume (1000 watt X 1 hour) 1000 watt hour or 1 kilowatt hour (kWh) of electricity.


1 Answers

Using adb tools you can view power consumption of each running app

adb shell dumpsys cpuinfo

sample output

Load: 1.12 / 1.07 / 1.01
CPU usage from 11344ms to 1613ms ago:
  10% 122/system_server: 5.8% user + 4.5% kernel / faults: 989 minor
  0% 233/com.htc.android.wallpaper: 0% user + 0% kernel / faults: 910 minor
  0.8% 271/com.htc.launcher: 0.8% user + 0% kernel / faults: 832 minor
  0% 40/panel_on/0: 0% user + 0% kernel
  0% 8/suspend: 0% user + 0% kernel
  0% 54/synaptics_wq: 0% user + 0% kernel
  0.2% 57/w1_bus_master1: 0% user + 0.2% kernel
  0% 253/com.android.phone: 0% user + 0% kernel / faults: 3 minor
  0% 13/kondemand/0: 0% user + 0% kernel
  0% 56/curcial_wq: 0% user + 0% kernel
  0% 2879/com.htc.bg: 0% user + 0% kernel / faults: 8 minor
  0% 2904/dhd_dpc: 0% user + 0% kernel
  0% 2906/com.google.android.apps.maps:NetworkLocationService: 0% user + 0% kern

Using batterystats you can view each app's battery usage and power consumption:

adb shell dumpsys batterystats

To list all available dumpsys tools:

adb shell dumpsys -l

To configure adb tools: http://developer.android.com/guide/developing/tools/adb.html

like image 145
UdayaLakmal Avatar answered Sep 28 '22 04:09

UdayaLakmal