free web page counters

Windows Mobile Pocket PC Smartphone Programming

==>Click here for the SiteMap<==. Original contents with decent amount of source codes.

Monday, September 26, 2005

Pocket PC Power Management Series 1: the Challenge to Developers

====>SiteMap of this Blog<===

Pocket PC Power Management Series 1: the Challenge to Developers

If you own a Pocket PC, you may notice that its screen frequently turns off, if the device is not used for certain time. The time can be adjusted via “Start => Settings => System => Battery => Advanced”. By default it is 3 minutes.

To turn off the screen is a good thing to the battery life, as the LCD display often turns out to the big battery sucker, especially if backlight is configured to be very bright. However, for some reason, Microsoft deemed that to turn off the CPU might save even more battery. So here comes a unique power model in Pocket PC: The system is also suspended after the device is not used for certain time. Or we say the system is sleeping, in sleep mode.

When the system is “suspended”, or when the device is “sleeping”, all threads are suspended. Let us say you have a nicely written application that has a great UI (controlled by one thread) and a hard-working background thread that analyzes storage data and also interacts with the UI thread. When the system is suspended, neither of your two threads gets a chance to run.

When the devie is sleeping, THE THREADS SIMPLY DO NOT RUN! Period.

Compared to a desktop machine, if the machine is not used for certain time, a screen saver may be started, or the power management system may kick in and turn off the screen. Whatever, the CPU is still spinning; any of your threads can still run as usual.

Such unique power model in Pocket PC presents unique challenge to developing programs that need to run for a long time uninterrupted (or need to run even if the system is suspended). I’ll come up with a few blog posts soon on how to write such a program, mainly:

  1. General principles
  2. Force the device to run?
  3. Request the device to run?
  4. GetTickCount vs GetLocalTime
  5. Older notification functions
  6. Newer notification functions
Please notice the smartphone series does not have such power model. Smartphone is more like destkop windows. A smartphone either runs all the time, even if the SCREEN is turned off, or does not run at all, when the phone is turned off.

Category: [Power Management]

====>SiteMap of this Blog<===




[ [permalink] ]

1 Comments:

At August 29, 2009 12:40 PM, Blogger Mohammad Hawash said...

ty

http://visualcsamples.blogspot.com

 

Post a Comment

<< Home