Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Battery usage profiling

Is there any way to profile the battery usage by the application in development environment or real time? BatteryManager seems not providing any per application API

like image 816
Mithun Sreedharan Avatar asked Mar 01 '11 09:03

Mithun Sreedharan


People also ask

How do you see which apps are using the most battery Android?

Step 1: Open the main settings area of your phone by pressing the Menu button and then choosing Settings. Step 2: Scroll down in this menu to "About phone" and press it. Step 3: On the next menu, choose "Battery use." Step 4: Look over the list of apps that are using the battery the most.

How can you do profiling on your Android smartphone?

In Android Studio, launch the profiler by selecting View > Tool Windows > Profiler. button in the profiler to see the dropdown menu. Select your device, then select the application's entry under Other profileable processes. The profiler should attach to the application.

How do I check power consumption on Android?

Checking Power Consumption To check the power consumption on your device, find the Android Settings menu and look for Battery. You will see a graph of power usage broken down by apps and phone functions.


2 Answers

I don't think that is possible at the moment.

There is a private API, PowerProfile, for retrieving battery consumption on a subsystem level (see http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/com/android/internal/os/PowerProfile.java). Also take a look at the code for the fuel gauge you find in Android's settings on how they calculate power consumption: http://google.com/codesearch/p?hl=en#ohAXAHj6Njg/src/com/android/settings/fuelgauge/PowerUsageSummary.java

like image 65
andyandy Avatar answered Oct 20 '22 05:10

andyandy


There's a new tool called "little eye" that does this.

It can profile Battery, CPU, Wifi and Data usage for an App in a development environment. Its a commercial product, but in beta right now, so free to download (for the moment). (disclaimer: I work at little eye)

http://www.littleeye.co

like image 2
PowerPanda Avatar answered Oct 20 '22 06:10

PowerPanda