user1696978
user1696978

Reputation: 121

Android App power consumption

How to check the power consumption in each applications in Android?
At least the power consumption should be relative when compared with different applications and these applications might be using any of the services like WIFI,GPS,LCD,wakelock, etc.

Are there any APIs in android regarding the same in order to measure the power consumption for the applications using the above resources?

Upvotes: 10

Views: 23900

Answers (6)

Parry Hotter
Parry Hotter

Reputation: 101

First, the powertutor from Google Play is out of date. I've checked the source code of it, and find that the power estimation model is for some old mobile models. The value from power tutor is way smaller than the actual power consumption.

Therefore, I would recommend you to use Battery Historian which is developed by google used to estimate battery consumption of each App. But it's written in Python/Go. It will illustrate the hardware invocation in a html file. And you can find battery consumption of each App in a corresponding text file.

Battery Historian Example

Upvotes: 5

AlexA
AlexA

Reputation: 271

You cannot programatically check the battery consumption for each application. Instead you can check the overall consumption like this:

energyLeftInmAh = device battery capacity in mAh * battery level in % * 0.01;

E.g Nexus 5, battery capacity: 2300 mAh

  mBatteryManager = (BatteryManager)MainActivity.this.getSystemService(Context.BATTERY_SERVICE);
  int level = mBatteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY);
  double mAh = (2300 * level * 0.01);

Upvotes: 4

Kumar Rangarajan
Kumar Rangarajan

Reputation: 431

(disclaimer: I co-founded the company which built the below mentioned product)

Try Little Eye from Little Eye Labs, that does exactly this. One can track an individual app's power and get the breakdown by CPU/display & Wifi (the upcoming version will support GPS and 3G). It also goes beyond power and tracks data, memory and CPU consumption of an individual app. Note its a desktop tool that you need to download and install from here.

Hope this helps.

Upvotes: 2

ishan
ishan

Reputation: 1099

Check out Powertutor. It is in my experience the best application out there to measure application wise power consumption. It is not 100% accurate but is good enough for estimations.

Upvotes: 4

Yury
Yury

Reputation: 20936

There is a research paper called “Accurate Online Power Estimation and Automatic Battery Behavior Based Power Model Generation for Smartphones”. For this paper the researchers developed a tool called PowerTutor, the sources of which you can find here. It should be mentioned that your device has to be rooted to use this application.

Upvotes: 5

Royston Pinto
Royston Pinto

Reputation: 6721

One easy guide to see which is consuming how much battery from ICS onwards is to check Settings->Battery. Here it shows the % consumed by the app. Other ways could be to physically monitor battery drop by using the app intensively, for e.g. battery may be 80% before u start using the app. Then you try for 30 minutes and then check battery % again.

Upvotes: 1

Related Questions