FORUMS

[GUIDE] HOW-TO Properly Evaluate Battery Life and Provide Useful Reports

4,534 posts
Thanks Meter: 5,235
 
Post Reply Email Thread
I was talking to DoomLord about the infamous battery drain hunt and we got to discussing about ways to pinpoint the issue.
At some point, I mentioned an app that I swear by, BetterBatteryStats, by chamomix.
So, DoomLord encouraged me to start this thread to provide info about how to effectively use this app to accurately locate causes of battery drain issue.
This is very important for users who want to evaluate kernels' performance on that department, but it doesn't stop there.
You can use this app to see if any application you installed is acting up and keeping your phone awake, for example.

Before proceeding with this guide, I have to mention that BetterBatteryStats is given away for FREE for all XDA users (do not redistribute though) and there is also a paid version on the Market for people who wish to support the developer. I bought this app and I am sure that if you read this guide, by the end, you are going to want to do the same! Thanks chamomix!

Step 1:

Download the app from this post for free, or buy it from the Market.

Step 2:

So, what is all these???

Don't panic! First, let's set it up in a way that it'll make things less complicated.
Launch the app and hit the Menu button, then select Preferences.

DISPLAY:
Make sure Filter stats is checked.
Hide time since stat begin should be unchecked.
Hide graph bars also unchecked.

DEFAULTS:
Default stat: It can be anything. This is what you will first see when you launch the app. I have set it to Other, so I can take a quick glance at how long the phone was asleep and how long the screen was on everytime I open the app.
Default stat type: Better set it to Since charged. Again, this is just what you will see first. You can navigate through all the other stat and display times later.

WAKELOCK:
Wakelock pct of: Choose % of time awake minus time with screen on. This is VERY important. When a developer asks for reports on wakelocks, all users should use the same option, otherwise the stats vary and thus can be misleading and not helpful.

All the other settings are unimportant, tune them as you wish.



Step 3:

Now what?

Now you have all the info you need about where did your battery go right there in front of you! I am going to help you interpret it.
We will use my phone usage as an example.
This is what I see when I launch the app:



So, my battery is at 97%, it was charged to 100% 21 minutes ago, it was awake for 20 minutes and the screen was on for 8 minutes.
That means that my phone was not sleeping even thought the screen was off for (20 - 8 =) 12 minutes.

Interesting...

Let's press the first dropdown menu and select Partial Wakelocks to figure it out.
Here's what I see:



Browser takes the first place with 2 minutes wakelock, then my Gmail sync with 1 minute and the rest with a lot less.
So, yeah, I left my browser on loading a webpage and the screen switched off.

Up to this point, we got a good idea of what app or process may be a battery drainer.

Moving on, we will investigate more advanced aspects of battery drain, useful for kernel testing and not only.

Step 4:

Is that all???

Oh no, hardly. You can see much more with this app.

Let's select Process from the first dropdown menu to see which processes used CPU power and when.
Here's what I see:



Notice how the bars can have 2 different colors.
Blue part of the bar means that the app/process used CPU power while the screen was on.
Red part of the bar means that the app/process used CPU power while the screen was off.

akmd8975 is the G-sensor (wherever you see akmd means the G-sensor), so for some reason it's using more processing power than it should. I am currently testing a new kernel, so I must inform the creator about it because this is the first time I see this in my stats.
(And that, my friends, is an example of how you should use all these for the general good. )

mediaserver is the process that imports all your media files to the gallery, usually it shows high usage after reboot, but after a while, it fades out (because there's a check for new media files upon every boot).

Now let's choose Kernel Wakelocks from the dropdown menu to see even more.



This is something you should leave to the kernel developer to interpret.
Most of these things are gibberish for us average users but can be VERY helpful to devs.
(I can safely say that the 3 first entries are related to charging and they only appear while you are charging the phone and shortly after. No need to get into deeper.)

Now let's take a look into the Alarms.
What are Alarms?
In layman's terms, Alarms in the Android system are those intents that wake up the phone in intervals or at a specific time. I am sure you can think of many apps that do that. Let's see which apps do that on my phone.

Hit Menu -> More -> Alarms



com.google.android.gsf is Google Apps Framework (your Gmail account, and related syncs and services).

android is the Android System itself which seems to be waking up my phone way too often (104 times in 20 minutes ). One more thing I should discuss with the kernel developer.

Step 5

I get it now! How can I gather all this info into one place?

By hitting menu button, selecting More -> Dump to File.
It will create a txt file on /sdcard named BetterBatteryStats-xxxx-xx-xx-xxxxxxx.txt (where the xxxxx indicate the date and time).
And the file will look somewhat like this when opened:



So, be it an app, a kernel or a ROM you are testing, you need this app!!!
As a co-creator of TEAM ROM for the X10, I have to tell you, I love all our users for their support, but sometimes I just want to scream when I see a post like this:

Quote:

my battery drains fast why???

You see what the problem with this post is?
I CAN'T POSSIBLY KNOW WHY. It could be SO many things.
That's where BetterBatteryStats comes to the rescue!
Use it! You will help yourself and your beloved developers beyond words!

If you feel all this is "too complicated" for you and you don't want to bother, please consider how many complicated things developers are doing for you for free. You owe them at least decent reports. Am I right or am I right?

PS: If you liked this guide, don't forget to check another one about How to Report Force Closes in an App or ROM by PvyParts.
The Following 242 Users Say Thank You to iridaki For This Useful Post: [ View ] Gift iridaki Ad-Free
7th January 2012, 08:41 PM |#2  
iridaki's Avatar
OP Retired Forum Moderator
Flag Edinburgh, Scotland
Thanks Meter: 5,235
 
Donate to Me
More
[i might need this one]
The Following 6 Users Say Thank You to iridaki For This Useful Post: [ View ] Gift iridaki Ad-Free
7th January 2012, 08:42 PM |#3  
iridaki's Avatar
OP Retired Forum Moderator
Flag Edinburgh, Scotland
Thanks Meter: 5,235
 
Donate to Me
More
[i might need this one too]
The Following 5 Users Say Thank You to iridaki For This Useful Post: [ View ] Gift iridaki Ad-Free
7th January 2012, 10:21 PM |#4  
Senior Member
Flag Florianópolis
Thanks Meter: 2,550
 
Donate to Me
More
Very good guide iridaki, thanks.

And about the BetterBatteryStats, I bought the Market version, and is a great app.

Highly recommended.
The Following User Says Thank You to adrianom For This Useful Post: [ View ] Gift adrianom Ad-Free
8th January 2012, 03:05 AM |#5  
mr.alawi's Avatar
Senior Member
Thanks Meter: 55
 
More
wow thanks iridaki for the Guide with this i will try to help Doomlord,FXP team to report about their kernel so they would come up with the perfect kernel for us

thanks again iridaki ^_^
8th January 2012, 05:00 AM |#6  
iridaki's Avatar
OP Retired Forum Moderator
Flag Edinburgh, Scotland
Thanks Meter: 5,235
 
Donate to Me
More
Thanks for your kind words.

Apparently according to XDA rules, this thread belongs to General section, among threads such as "Help I am a noob" and "Is it Sunday today?" but because Doomlord (who has released a lot of V16 test kernels and needs our help to solve battery issues) as well as other kernel/ROM/app developers could benefit if us users followed this tutorial for reporting, please bookmark this thread and link to it in the development section whenever you see fit. For example when someone asks about how to check which apps drain their battery.
Thanks a lot!

iR¡[email protected]!* via Tapatalk
The Following 3 Users Say Thank You to iridaki For This Useful Post: [ View ] Gift iridaki Ad-Free
8th January 2012, 06:19 AM |#7  
Ninolina's Avatar
Senior Member
Flag Beograd
Thanks Meter: 1,199
 
More
I want to thank you too for making this tutorial..:) I am also testing DooMLorD's kernel and will use this so I can give better feedback..:)

Thank you..:)
The Following User Says Thank You to Ninolina For This Useful Post: [ View ] Gift Ninolina Ad-Free
8th January 2012, 11:36 AM |#8  
Member
Thanks Meter: 2
 
More
Great! Starting with test1 today. Too bad I can't post my results in the other thread since I'm new here though...
8th January 2012, 12:49 PM |#9  
iridaki's Avatar
OP Retired Forum Moderator
Flag Edinburgh, Scotland
Thanks Meter: 5,235
 
Donate to Me
More
Quote:
Originally Posted by frelle218

Great! Starting with test1 today. Too bad I can't post my results in the other thread since I'm new here though...

Post them here, I can link them to DoomLord's thread.
8th January 2012, 03:47 PM |#10  
shaynethepain's Avatar
Member
Flag Mumbai
Thanks Meter: 13
 
More
This is a very good guide. Thanks Iridaki.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes