I have a simple Windows Mobile application which records GPS coordinates
every 5 minutes. The problem is the app works fine as long as the screen
is on, as soon as the phone goes in standby mode the app stops working.
When I switch on the device the app again starts working again.
What do I do to keep the app working even in standby mode?
Sandeep
Best Answer
My experience with GPS is that it takes a while to get a fix (at least on my device), so I think you have to keep the phone from suspended state all the time. When I’ve been playing around with my device I’ve noticed that I have to use the built in music player to get a fix while the screen is off. As ratchetr pointed out PowerPolicyNotify(PPN_UNATTENDEDMODE,TRUE) seems to be the right way to prevent the "music player requirement".
Edit: It also seems like you have to use SetPowerRequirement / ReleasePowerRequirement on some devices.
Here is a C# sample: