views:

1118

answers:

3

I have a .net 3.5 application running on windows mobile professional that uses sql server ce 3.5 and merge replication with sql server 2005 sp2, it not yet a 1.0 product. Every couple of minutes or so it starts a merge replication using a timer control. I suppose down the line I'll have to have some kind of push senario, either using long lived HTTP requests or Window Mobile Email WCF. However in the meantime my problem is that the devices are being "put to sleep" whilst waiting for the polling timer, either by the device reaching it's idle power down timeout or by the user hitting the standby button. I thought it was just the screen and keyboard that got powered down but it turns out that it's most of the devices functions, including my app.

Is there any way I can catch the standby event and just power down the screen and keyboard but keep my app running?

+1  A: 

Do the suggestions in this thread help you?

CodeProject has this article with a very detailed explanation of Windows Mobile power states.

Tim Cavanaugh
+2  A: 

I recommend that you don't disable the sleep mode, but instead register events to wake up your device and run your task. Have a look at the Smart Device Framework at OpenNetCf. Among others there you will find:

  • Methods for registering wake up events
  • Event handlers for Power Down events

Most of them are in the OpenNETCF.WindowsCE namespace.

kgiannakakis
A: 

Maybe the answer to this SO question is of help: How can I run code on Windows Mobile while being suspended? It uses the "unattended" mode to keep the application running with screen switched off.

vividos