1. Download our Official Android App: Forums for Android!

Root Battery stats good or bad to clear

Discussion in 'Android Devices' started by trapperjohn, Aug 22, 2011.

  1. trapperjohn

    trapperjohn Well-Known Member
    Thread Starter
    Rank:
     #228
    Points:
    53
    Posts:
    212
    Joined:
    Dec 25, 2009

    Dec 25, 2009
    212
    30
    53
    Male
    Hi,
    I installed cm7 which really makes my phone fly compared to stock :) I can only imagine how much faster it will be with other roms that are tweaked for speed!
    But before I start changing roms I wanted to get clarification on how you would recommend handling battery stats file.
    Should it be cleared and if so what is the best way to have it relearn the battery usage, I ask since I have seen conflicting ways on how to handle this.
    Thanks,
    Bryan
     

    Advertisement

  2. WormDoes

    WormDoes Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    3,199
    Joined:
    Aug 8, 2010

    Aug 8, 2010
    3,199
    1,270
    313
    Sales
    Massachusetts
    Charge battery to 100%. Wipe Battery stats. Drain to 0% (let phone shut itself off) Charge to 100%. Use as normal. You can do this every time you flash something, but it becomes a pain. I usually just wipe stats with out calibrating.
     
    Thats and trapperjohn like this.
  3. tythunder

    tythunder Well-Known Member
    Rank:
    None
    Points:
    36
    Posts:
    104
    Joined:
    Apr 5, 2011

    Apr 5, 2011
    104
    7
    36
    May I ask what is the benefit of this, and don't you wipe battery stats through recovery
     
  4. Yeahha

    Yeahha Usually off topic
    Rank:
     #29
    Points:
    913
    Posts:
    10,474
    Joined:
    Jul 29, 2010

    Jul 29, 2010
    10,474
    4,694
    913
    ...
    FG
    Yes you wipe in recovery, front to back (oh wait that is with babies), If you do not wipe your battery stats you may get inaccurate readings with the battery in the notification bar as well as any battery widgets you use, if you wipe without a full battery you will also get inaccurate readings. I have seen many things to do after you wipe, I personally wipe and go on with my life, I don't usually have the time to let the battery die completely then charge up completely without cutting the phone on.
     
  5. brizey

    brizey Android Enthusiast
    Rank:
    None
    Points:
    93
    Posts:
    591
    Joined:
    Jun 25, 2011

    Jun 25, 2011
    591
    120
    93
    You can use the battery calibration app in the market if you don't want to mess with recovery. I have only done the discharge recharge thing once or twice.
     
  6. jackdubl

    jackdubl Android Expert
    Rank:
    None
    Points:
    93
    Posts:
    986
    Joined:
    May 18, 2010

    May 18, 2010
    986
    111
    93
    Topeka, KS
    Does it make any difference if you rarely charge your phone? I have two spares and I swap out once to twice a day 'cause I hate having to plug in my phone.
     
  7. Yeahha

    Yeahha Usually off topic
    Rank:
     #29
    Points:
    913
    Posts:
    10,474
    Joined:
    Jul 29, 2010

    Jul 29, 2010
    10,474
    4,694
    913
    ...
    FG
    I am not sure but I would think it would help if you swap batteries. I believe part of the calibration is how fast the phone drains the battery, because this is variable based on the amount of cycles the battery has been thru I think this would make clearing stats a moot point. Really all this is for is to try to ensure proper reading of your battery level, it should not affect actually battery life.
     
  8. trapperjohn

    trapperjohn Well-Known Member
    Thread Starter
    Rank:
     #228
    Points:
    53
    Posts:
    212
    Joined:
    Dec 25, 2009

    Dec 25, 2009
    212
    30
    53
    Male

    Hi,
    I followed your method and so far in first full day I notice less pausing on a percentage number than before, so basically I don't seem to see anymore a long pause at 64 % then a faster drop then slow all while doing the same thing at the time so battery is more consistent :)
    Thanks for your help!
    Bryan
     
  9. brizey

    brizey Android Enthusiast
    Rank:
    None
    Points:
    93
    Posts:
    591
    Joined:
    Jun 25, 2011

    Jun 25, 2011
    591
    120
    93
    You know, the more I think about this, I think I would rather just get the battery voltage and learn to interpret it myself.
     
  10. Yeahha

    Yeahha Usually off topic
    Rank:
     #29
    Points:
    913
    Posts:
    10,474
    Joined:
    Jul 29, 2010

    Jul 29, 2010
    10,474
    4,694
    913
    ...
    FG
    Not sure what you are saying here, you can manually undervolt but unless you are going to keep track of what the voltages are at all times and subtract that from your battery when full as well as take into account things like battery degradation from cycles I don't think you will be able to manually make an accurate estimation of your battery percentage.
     
  11. brizey

    brizey Android Enthusiast
    Rank:
    None
    Points:
    93
    Posts:
    591
    Joined:
    Jun 25, 2011

    Jun 25, 2011
    591
    120
    93
    I guess to me a percentage is not that much more abstracted--you have to take into account how various apps and uses (like screen brightness) affect battery life for it to have any meaning. In other words, when my battery says 50%, that means that the algorithms are estimating that my 1700 mAh battery has 850 mAh left--now it is up to me to decide what that means in terms of how many songs I can listen too if the screen is on in sunlight and 4G on but the GPS off, etc. etc. You already have to do 90% of the estimation in your head, so why not just do 100% of it?
     
  12. Yeahha

    Yeahha Usually off topic
    Rank:
     #29
    Points:
    913
    Posts:
    10,474
    Joined:
    Jul 29, 2010

    Jul 29, 2010
    10,474
    4,694
    913
    ...
    FG
    I am not sure we are talking about the same thing. Wipe battery stats wipes the files that the phone uses to calculate the battery % left. These can be thrown off by things like booting into recovery the time you spend making backups/wiping/flashing/looking at emo horse are not tracked so it can cause issues over time with how your phone reflects the battery remaining. It is still up to you to determine what is causing the battery drain, but I fail to see how you will calculate how much juice is left in your battery without an accurate reading from the phone to be able to tell there is 850 mAh left in your battery.
     
  13. Yellow Snowman

    Yellow Snowman Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    344
    Joined:
    Mar 16, 2011

    Mar 16, 2011
    344
    40
    43
    How do you wipe stats? I cant seem to find an option for that? Just a refresh button.
     
  14. tythunder

    tythunder Well-Known Member
    Rank:
    None
    Points:
    36
    Posts:
    104
    Joined:
    Apr 5, 2011

    Apr 5, 2011
    104
    7
    36
    Reboot into recovery, go to advanced, wipe battery stats
     
    Yellow Snowman likes this.
  15. Yellow Snowman

    Yellow Snowman Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    344
    Joined:
    Mar 16, 2011

    Mar 16, 2011
    344
    40
    43
    I'm always amazed at how much help all you guys are. Trust me, it is greatly appreciated.

    Keep bringing the knowledge!
     
  16. trapperjohn

    trapperjohn Well-Known Member
    Thread Starter
    Rank:
     #228
    Points:
    53
    Posts:
    212
    Joined:
    Dec 25, 2009

    Dec 25, 2009
    212
    30
    53
    Male

    I have to 2nd that!!
    Bryan
     
  17. brizey

    brizey Android Enthusiast
    Rank:
    None
    Points:
    93
    Posts:
    591
    Joined:
    Jun 25, 2011

    Jun 25, 2011
    591
    120
    93
    I always assumed that the battery stats was storing the parameters of the voltage vs. capacity curve for the particular battery. I know that lithium ion batteries do a lot of weird stuff (i.e. temperature dependencies), but they still have a voltage vs. capacity curve. They only thing the phone can measure about the battery's state of discharge is the voltage (and I guess the temperature gives you some info, too, but it only refines the info from voltage).

    I have never understood why things like booting into recovery would affect it unless they are doing something like trying to integrate the current draw...and even if they were, the program should be smart enough to only integrate through contiguous data points in terms of time. They should be able to take little chunks of this integration to refine the curve, and a block of missing data should make it less refined, not erroneous. You take the current draw at spaced times and multiply by the time intervals to get and approximate mAh drain, then compare that to the voltages over the same intervals. This gives you a small chunk of real data to compare to your model of the voltage vs. capacity curve. You then use this information to refine the model to more accurately reflect actual usage. I don't see how booting into recovery would affect this process other than stopping it...which would not ruin it--just take some data points away.

    What I really would like to know is why a nominal curve would not be 90-95% accurate--which is close enough (e.g. 21% or 22% left vs. 20% left is close enough). Gonna have to read up a bit more on this if I can find anything.

    Edit: one more thing--I kind of over simplified things a bit--it is more of a manifold than a curve since the effective capacity is affected by the current draw because of losses due to internal resistance--in other words, rapid discharge effectively reduces the capacity of the battery because the higher current results in higher internal resistance losses. Still--the booting into recovery does not affect this either.
     
  18. Yeahha

    Yeahha Usually off topic
    Rank:
     #29
    Points:
    913
    Posts:
    10,474
    Joined:
    Jul 29, 2010

    Jul 29, 2010
    10,474
    4,694
    913
    ...
    FG
    I'm really tired and may have to edit this tomorrow by I think the reason booting into recovery causes the stats to get messed up is with the OS not running it has no way of keeping track of how much the battery has discharged between when you entered recovery and rebooted. I could be easily wrong, in fact there may be a place within one of the recoveries that show battery level, but it could be the recovery is looking at the same stats the is looks at and doing it's own approximations to show this.
     
  19. brizey

    brizey Android Enthusiast
    Rank:
    None
    Points:
    93
    Posts:
    591
    Joined:
    Jun 25, 2011

    Jun 25, 2011
    591
    120
    93
    Still don't get it. What if you are not rooted and swap batteries? The voltage should be able to get the OS pretty close. There must be something else going on...some sort of corruption.
     
  20. Yeahha

    Yeahha Usually off topic
    Rank:
     #29
    Points:
    913
    Posts:
    10,474
    Joined:
    Jul 29, 2010

    Jul 29, 2010
    10,474
    4,694
    913
    ...
    FG
    Some things you may want to look at. BatteryManager | Android Developers()
    Intent | Android Developers
    and
    https://market.android.com/details?id=com.manor.currentwidget&feature=search_result
    and
    https://market.android.com/details?id=ccc71.bmw&feature=related_apps

    The first two links are to the SDK reference guide. From what I can tell battery stats are calculated here. With EXTRA_SCALE being max charge and EXTRA_LEVEL being current charge between 0 and EXTRA_SCALE. I would assume EXTRA_ICON_SMALL is calculated with those other two strings. From what I can tell it look like it only uses voltage and temp as well as history (battery stats like max charge) to calculate these so I would also guess you are on the right path to coming up with a manual way to calculate it very close to what the system does as well. I actually doubt android takes temp into account with it's calculations, it likely relies only on discharge. Wiping battery stats should wipe the graph clean, you charge it up and it creates a new graph based on the data it collects after the wipe. This also would help explain why what worm said would work for calibrating, the OS could get a reading at all levels, if you were to do it more than once it *should* get more refined. I think all you would need to calculate it manually would be a way to read the string EXTRA_VOLTAGE and you could then be set.

    The market links are the only 2 apps I could find that I thought would relate to this at all, I don't know if they would assist you at all but I figured I would link them anyways. Let me know if I am way out in left field with this or not :D
     
  21. brizey

    brizey Android Enthusiast
    Rank:
    None
    Points:
    93
    Posts:
    591
    Joined:
    Jun 25, 2011

    Jun 25, 2011
    591
    120
    93
    Once I get to a computer I will check those links out and report back what I can figure out. Sorry to the op for hijacking the thread, but I guess this is evolving into the battery tech thread.
     
  22. Yeahha

    Yeahha Usually off topic
    Rank:
     #29
    Points:
    913
    Posts:
    10,474
    Joined:
    Jul 29, 2010

    Jul 29, 2010
    10,474
    4,694
    913
    ...
    FG
    Close to on topic :D

    Thought about it and if the battery stats do keep track like I am thinking I do not think android would take temp into account on it at all. I am not as knowledgeable about the specific dynamics of batteries as I could be but I would think that if the battery heated up and caused drain that would be reflected in the voltage reading?
     
  23. brizey

    brizey Android Enthusiast
    Rank:
    None
    Points:
    93
    Posts:
    591
    Joined:
    Jun 25, 2011

    Jun 25, 2011
    591
    120
    93
    Sort of. If the temperature is higher, the battery had higher internal losses at at given current draw. And here is the complicated part--a higher current draw increases the battery temperature temporarily. So drawing 100 mA for 2 hours is not the same as drawing 200 mA for one hour. Both are 200 mAh, but the 200 mA draw will increase the battery temperature, so more energy is lost to heat within the battery. In practical terms, I think it basically means that our obsession with single digit precision for battery capacity is kind of pointless since we do not know if the next thing we do will be low current draw or high current draw.

    Oh, and lithium ion batteries have very low but not negligible self drain (mostly due to the onboard voltage monitors). They also lose a lot of capacity as time goes on, but in something as active as a smartphone, this loss of capacity should be able to be monitored (it is a fraction of a percent per day).
     
    trapperjohn likes this.
  24. trapperjohn

    trapperjohn Well-Known Member
    Thread Starter
    Rank:
     #228
    Points:
    53
    Posts:
    212
    Joined:
    Dec 25, 2009

    Dec 25, 2009
    212
    30
    53
    Male

    Hi,
    Not a problem :) Still related..
    Learning alot from these posts :)
    Thanks,
    Bryan
     
  25. Yeahha

    Yeahha Usually off topic
    Rank:
     #29
    Points:
    913
    Posts:
    10,474
    Joined:
    Jul 29, 2010

    Jul 29, 2010
    10,474
    4,694
    913
    ...
    FG

    I would think after the heat loss the voltage would show as diminished, meaning with the correct amount of data you should still be able to get an accurate reading of battery level.

    It would be interesting to know what all the battery stats collect. If they keep things like average draw and average battery temp the calculations could compensate for unknown variables. If that is the case it also helps explain why it is important to wipe battery stats, if you undervolt but have average draw stats from stock for 2 months before undervolting it would give inaccurate readings.
     

Share This Page

Loading...