Search code examples
androidbattery

How to find the battery recharge time of android mobile programatically?


I wanted to know that how can we find how much time android device will take to fully charge its battery.

For example if my battery is 0% charged then how long it will take to charge full i.e. 100%, same if my device is 70% charge so if i connect charger now then how long it will take to full charge my device.


Solution

  • You should read the official documentation about this. Basically you'll need to use BatteryManager class to find out current state of battery level.