Calculate power consumption of Android sensor

getPower () returns the power in mA used by the sensor during use:

Now I need to calculate how much battery is used when registering the sensor.

Does he know the value returned by getPower (), indicates mAH (mA per HOUR) or something else? If so, is there a way to get mAH batteries to calculate the% battery used by the sensor?

+8
java android sensor
source share
1 answer

Not so long ago, something very close was discussed in Google groups. You can find the full stream here for reference.

A small excerpt from the last answer in this thread, which should answer your question more or less:

(...) battery capacity is always given in terms of mAH. (...) What matters is how long the battery can supply a given current at its rated voltage. 3800 mAh means that it can supply 3800 mA in 1 hour. Knowing this, it now makes sense that the API provides current drainage as an indicator of energy consumption. Now you can calculate how much effect the battery life will have as a function of time.

+2
source share

All Articles