3

In Android Lollipop, how do I see how long it has been since the last time I charged the battery? I mean I can get the approximate time by eye-balling the graph shown in Settings -> Battery. But, is it possible to get a precise time period like: "your device has been running x hours y minutes since last charge".

Or any app that can give me this info? All battery apps seem to concentrate on telling me how much longer the device can last from now. No history info.

Note: I'm not asking about the up time :-)

1
  • Oh man, why would they remove this info? Thank you, Ashwin, for asking this question! Commented Mar 2, 2016 at 13:38

4 Answers 4

3

From a root terminal on your device:

dumpsys batterystats | grep "Start clock time"

That will give the date/time of when the device was last disconnected from the charger (while fully charged), rather than the time since, but comparing to the current date and time is easy enough.

I did come up with a more complicated command you could save to a script to yield a 1d 2h 3m style format:

busybox expr $(date +%s) - $(dumpsys batterystats --checkin | grep "l,bt" | busybox awk -F',' '{printf "%i", $10/1000}') | busybox awk '{printf "%id %ih %im\n", $1/60/60/24, $1/60/60 % 24, $1/60 % 60}'

To explain that:

  1. Get the batterystats line that includes the milliseconds-since-the-epoch time of the last charger disconnection
  2. Use awk to strip out that time and convert it to seconds
  3. Subtract it from the current time to get the interval in seconds
  4. Use awk to format it
2

Try Battery Monitor Widget

With Battery Monitor you can control your Battery status, here are some features:

  • Unplugged since
  • Last level change
  • Total charges
  • Total charging time
  • Total unplugged time
  • And many others

The google play page

Hope it will help.

2

I think the best battery info app on the play store is BatteryBot Battery Indicator.

It will show all the info about battery.

-2

Go to battery in setting, press battery usage button then you can see the exact time passed since last charge

1
  • 2
    What phone and Android version did you try this on? My Nexus 5 running Marshmallow doesn't have a "Battery usage" button on that screen.
    – Dan Hulme
    Commented Jul 7, 2016 at 11:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .