Mar 22 2009

Windows Mobile Power Management part 2 - Setup

Category: MobileJoel Ivory Johnson @ 07:10

Some time last year I wrote an article on Windows Mobile Power Management. Overall the article has been well received and I've seen it referenced by quite a bit of device developers on the MSDN forums and other forums.  Having been well received I'm going to spend some more time on adding to it (if you've seen the article you may have noticed a number '1' at the end of the URL.  That's a subtle expression that I planned to add another article).

This time around I'm going to measure how much certain tasks and programming concepts affect battery life. I've got both a Windows Mobile Standard and a Windows Mobile Professional phone that I'm not using. For both of them I'll first need to base line the total standby time I get while the devices are unused. Since the accuracy of the internal battery meter can varry I'm going to ignore it.  My measurement will be based on how many hours it takes for the device to shutdown due to insufficient power.  All other measurements will expressed in the percentage of the baseline time achieved when I use a certain programming practive.  So if a certain practice causes the device's running time to be reduced by 20% then I will record the the total battery life as being 0.80.

A known inadequacy of this analysis is that its applicability to other devices isn't absolute.  Different devices and firmware use different power management and so the results could vary.  But my expectation is that the variance of results won't be radical and the information will be sufficient for making expectations.

A potential problem in this experiment is that the results will be changed by measuring them (kinda reminds me of the Hesienburg Uncertainity Principle).  Since I don't have the necessary hardware for detecting the current being pulled by the device my only method for knowing that the battery is still alive is to occasionally wake up the device and write a time stamp to a file.  waking up the device and writing to a file both consume power.  If I wake up the device one every few minutes the impact on battery life will interfere with the battery life significantly.  If I were to to only wake up the device once a day then the affect on battery life is less significant but then my measurements are more crude. So I've decided to create time stamps once every 2 hours.

This initial baselining will be slow since both the professional and Standard device that I have can last for several days before the battery is dead. Once I get my baselines I'll post more details on what I will be measuring.

Update: I've put together the program I needed.  Only took a few minutes since I already had a system event class.

Tags: ,