Extract battery life for Android

Is there a way to get the time from the moment of charging the battery?

This doesn't seem like a way to do this with BatteryManager, but they display it in your settings. I see the source here , but it does not look as if there is a way to capture it. Any help?

+3
source share
1 answer

You can configure the broadcast receiver for ACTION_POWER_DISCONNECTED and keep track of the last time it was broadcast.

0
source

Source: https://habr.com/ru/post/1755030/


All Articles