3

I want to calculate and show in a plot the power consumption of my app over the time. The x axis is the time (hours) and the y axis the power consumption in mW.

I have the discharge values for my application (100, 93, 82, 78, 71, 64, 59, 49, 41) that correspond to initial charge, 1h, 2h... The battery of the smartphone is 3.7V and 1850mAh. I calculated the power consumption the same way:

cons(W) = voltage (V) * discharge amount (%)  * capacity (mAh) / discharge time (h)

cons (W) = 3.7V * 1.85 Ah * [100, 93, 82, 78, 71, 64, 59, 49, 41] / [0.1 1 2 3 4 5 6 7 8 ]

Is that correct? I know there is a way to directly obtain the values I need but I want to compare several apps and I don't have time to compute the values again. So, based on the previous calculation, What I am doing wrong? I am obtaining values too large. Any suggestion?

10 Rep
  • 2,217
  • 7
  • 19
  • 33
nabrugir
  • 1,839
  • 2
  • 22
  • 38
  • 2
    No, it's not correct - for one thing, the voltage varies widely during discharge of a cell of this chemistry. For another, it's very hard to separate the consumption due to the app from that of other systems and software on the device. Also the percentage values displayed are by no means reliable. – Chris Stratton Nov 17 '13 at 13:39
  • Thanks, I understand what you mean. However, since I want to compare with other apps available in the store, that's the only values I can obtain. I obtained with one of the apps to measure the battery consumption and it correspond to the total discharge of the phone. When you say the percentage values displayed are no reliable, what do you mean? The phone was running the background apps of the system + my app, which is a background app. The screen was off. – nabrugir Nov 17 '13 at 13:59
  • I mean that the battery "metering" on phones is not particularly accurate, having both offset and linearity errors since it is based a far from perfect attempt to transform the non-linear and age-dependent discharge curve back to a linear percentage. A comparative analysis based on processor utilization and wakelocks (etc) held by the app is likely to be more meaningful, even though it won't have power units. – Chris Stratton Nov 17 '13 at 14:16

1 Answers1

0

Android and iOS have the possibility to show power consumption on a per-app basis. At least Android should support API calls, to access these values. (These calculations are more valid then just using battery drain, still not perfect. [i.e. they use processor time, readout of sensor-values, ...])

possible duplicate: https://stackoverflow.com/questions/23428675/android-to-check-battery-stats-per-application

Community
  • 1
  • 1
Florian
  • 372
  • 2
  • 12