[General Topics] kwokshsee:
Do u know how battery efficient ur smartphone is?

How is the battery efficiency of kernel X compared to that of kernel Y?

Is there an objective way to work out battery efficiency (ie. other than appealing to ur subjective impression)?

Below is my tentative solution to the above questions :)

Requirement:

1. You need to be able to bootup into recovery mode where u can wipe the battery stat (e.g. CWM Recovery can do that. In most cases, u need a rooted phone to obtain CWM Recovery);

2. You need to be able to take screen shots;

3. CPU Spy (by storm717, free from Google Play. Disclaimer: this author doesn't have any affiliation with the app or its creator :P )

4. Know the total capacity (in mAH) of ur battery (can be read from the face or the back of ur battery)

Procedure

Step 1. Calibrate the battery level indicator of ur phone

Concerning the battery level, theoretically only two points can be certain: 100% (when the battery is fully charged) and 0% (when it is totally depleted). All in the middle are extrapolations based on either the 100% or the 0% point.

Practically, the 100% point is the only point against which the battery indicator can be accurately calibrated. Below is the how:

1a. Fully charge ur phone. Switch it off when the fully charge indicator is on BUT leave the charger connected to it at this point;

1b. Half an hour later, with the charger still attached, boot up into recovery mode;

1c. Choose "Wipe battery stat" from the recovery menu: (for CWM Recovery) scroll to "advanced", then "Wipe battery stat", then scroll down to highlight "yes, wipe battery stat". When it is highlighted, WAIT FOR 1 MORE MINUTE before u press the Home button to activate it (the wait will make extra sure ur battery level is truly, totally, and absolutely 100% :D)

1d. When that extra 1 minute is over, press the Home button to activate "yes, wipe the battery stat" --- now, the battery level indicator is accurately calibrated to 100%. (U now can see why u can never totally accurately calibrate against the 0% point: as soon as u reach the true 0%, ur phone is out and u can't reset the battery level indicator to zero when ur phone is out. That's why :) )

Step 2. Monitor ur battery consumption

2a. With Step 1 completed, reboot ur phone;

2b. From this time on, DO NOT ATTACH UR PHONE TO UR PC VIA USB OR SWITCH OFF OR REBOOT UR PHONE until the whole monitoring process is over;

2c. U may then use the phone any way u wish (with exception 2b above applied), but from time to time (say for every 4 or 6 hours), run CPU Spy and take a screen shot of the results it obtains each time (see for e.g. the pictures attached);

2d. The monitoring should continue until the battery level is around 10%

Step 3. Calculate the rate of battery consumption

After Step 2, u will have multiple screen shots showing ur battery consumption at various levels of battery discharge. U may use the data obtained to calculate the rate of consumption of ur device. Below is how:

3a. Take my own consumption (battery: 2,500 mAH stock battery, phone: Samsung Galaxy Note) as an example --- see Fig 1 attached.

When the battery level is 74%, the CPU stats are as followed:

Deep Sleep: 15h 22m 55s, 90%

200Mhz: 1h 13m 21s, 7%

etc.

Understandably, the rate of battery consumption is different at different CPU frequencies. So, we will calculate the respective rates one by one (when the data obtained permit so).

3b. To calculate the rate of consumption (in mA/sec), when the phone is in Deep Sleep, C(Deep Sleep):

Amount of battery used = 2,500 mA * (100 - 74)% * 90% = 585 mA

= C(DS)*(15*60 *60 + 22*60 +55)sec

Thus, C(DS) = 0.0106 mA/sec ---------------------------------------(1a)

Similarly for C(200Mhz) (rate of battery consumption when CPU is at 200Mhz)

C(200Mhz) = 0.0103 mA/sec ----------------------------------------(2a)

In theory, we can similarly calculate the rates C(500Mhz), C(800Mhz), etc. However, becoz the consumption % for those frequencies are below 1 and CPU Spy rounds all decimals to the nearest digit, so in practice the figures obtained cannot be used.

3C. Now, let's look at Fig 2, when the battery level is at 47%. The data obtained are:

Deep Sleep: 19h 29m 27s, 81%

200Mhz : 3h 15m 1s, 13%

etc.

Thus, C(DS) = 0.0153 mA/sec ----------------------------------------(1b)

C(200Mhz) = 0.0147 mA/sec -----------------------------------(2b)

Hence in my case (Samsung Galaxy Note, GB 2.3.6, Kingdroid v5.4 ROM, Speedmod K1-5 kernel, 2,500 mAH stock battery) the rate of battery consumption is around 0.011 to 0.015 mA/sec.

Limitations

1. The results obtained from the above method to calculate rates of battery consumption is system-dependent, meaning that meaningfully comparison between results can only be made for the same combination of phone + battery (system). Say u obtain C(Deep Sleep) for certain phone, OS, ROM, kernel is, for instance, Z mA/sec, this doesn't mean that for the phone model having the same OS, ROM, kernel, C(Deep Sleep) must be Z, becoz even for the same models the hardwares may be different and the battery may also be a bit different (different batches may behave slightly differently; and more importantly, the AGE of a battery can have significant effect on its performance, so batteries of the same model and the same batch may perform different owing to their different age). Nonetheless, u may make meaningful comparison when u compare results obtained for different OS's, ROM's, or kernels u install to ur system (phone + battery).

2. The rate of battery consumption with CPU at higher frequencies may not be derivable owing to the rounding of figures by CPU Spy.

******************************

Pls click "Thanks" if u find this makes good sense :)