Christopher Edwards
Christopher Edwards

Reputation: 6659

How do I keep a Windows Mobile Professional Device in the Unattended Power State

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?

Upvotes: 0

Views: 2724

Answers (2)

vividos
vividos

Reputation: 6778

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.

Upvotes: 0

kgiannakakis
kgiannakakis

Reputation: 104198

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.

Upvotes: 2

Related Questions