BharathVishal / BatteryStats-for-Android

Displays all battery stats of an Android device using broadcast receiver. Fully implemented in Jetpack compose using Material You dynamic theming and also has a separate implementation in xml with MDC 3.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Battery will die/empty in approx time remaining

qadirsuh opened this issue · comments

Hi, Congratulations for great battery stuff code.

I am searching for how to calculate the in how much estimated time my battery will be empty/die.
Android OS calculate this value too. here is screenshot of my phone.

image

Is there any native way to calc this value?
It will be great feature in your app :)

Hi,
Thanks for your suggestion and feedback. As of now there isn't a native Android API to calculate the remaining battery time and this has to be done through our own implementation.
Calculating the remaining battery time includes some sort of estimation based on the battery drain between timed intervals and other parameters like recent running apps, battery capacity in mAH, battery health, current battery voltage etc. I can implement an estimator in the future release.
Also, an API to calculate remaining time to charge fully is available only to devices running Android Pie(API 28) and above.