I am trying to find a way to get the battery consumption in absolute value. For example, currently there are many apps that shows the battery consumption in percentage (x% used by Y app). Is there any way to find the absolute value of battery consumed and value left? Let's say when battery is fully charged the value is F power unit and when it is used it reduces to X Power Unit. So the percentage could be said as (X/F * 100) % battery used.
Asked
Active
Viewed 49 times
0
-
Possible duplicate of [Check Battery Level iOS Swift](http://stackoverflow.com/questions/27475506/check-battery-level-ios-swift) – Ryan Nov 21 '16 at 21:48
-
Multiply the percentage with the battery capacity? – fishinear Nov 21 '16 at 21:59
-
Have you looked at the [BatteryManager API](https://developer.android.com/reference/android/os/BatteryManager.html), specifically at the CAPACITY constants? And BATTERY_PROPERTY_CHARGE_COUNTER? – Taylor Kidd Nov 22 '16 at 15:51