0

I need to get statistics about the battery in milliAmpere. I've already found how to get the battery percentage and voltage but not the current.

There are applications like this that can do it but i wonder how.

Thank you

Community
  • 1
  • 1
Boh
  • 1
  • possible duplicate of [Getting the battery current values for the Android Phone](http://stackoverflow.com/questions/2439619/getting-the-battery-current-values-for-the-android-phone) and [In Android, is there a way to get the battery current?](http://stackoverflow.com/questions/16765926/in-android-is-there-a-way-to-get-the-battery-current) – Jaa-c Aug 13 '13 at 23:56

2 Answers2

0

I believe the only way to get the current is via the logcat. The system will occasionally post it to there so you'll need to go back find the last update for it.

Jon
  • 1,398
  • 9
  • 14
0

There is no way of measuring current drawn from within the system - this or any other app can only estimate it based on timing information and voltage discharge that the system reports. You are not likely to have anything accurate based on just that though - to have more accurate information you need an accurate device power model.

There is a nice article by the Android framework guys about how the power model is built (also applies to the built-in battery power monitor).

TL;DR

  • Measurement can be accomplished using a bench power supply or using specialized battery-monitoring tools (such as Monsoon Solution Inc.’s Power Monitor and Power Tool software).
  • Need to control what components of the device are active (screen on/off/brightness level, cellular/wifi/bluetooth radio, gps, CPU, etc.)
  • Based on those you build an energy profile similar to the example at the bottom of the page
  • There are also typical values in the table in the document. Warning: these are highly hardware-dependent
  • You can then apply the model by monitoring the state of the device and activities of applications (screen state, foreground/background, CPU/network use by an app, etc.)

This is a lot of hard work (sorry about that :) ), but there isn't another good way - it is actually an active research problem...

AndriusA
  • 66
  • 4