locked
Prevent Application from stopping on Windows Mobile? RRS feed

  • Question

  • I have a windows mobile app that I've created that runs fine and does what it is supposed to do.

    Afer several minutes the application just stops working like the OS no longer lets it do its work. If I activate the app again (by selecting it in task manager) I can see what time it stopped because I show the time in a label, then it starts again and starts working.

    Question is, can I stop this from happening? I want the application to keep running even though it doesn't have focus.

    I spent a lot of time searching, but I may not be searching for the right stuff.

    thanks

    Ken

    Wednesday, May 5, 2010 2:20 AM

Answers

All replies

  • Hi Ken ,

    "Afer several minutes the application just stops working "

    Does your program stop even it is the Forground program , or it happens only when you set focus to another program ?

     

    "If I activate the app again (by selecting it in task manager) I can see what time it stopped because I show the time in a label, then it starts again and starts working."

    Do you use any code in LostFocus Event that may stop the program from updating the Label with the current time so it doesn't consume mobile battery , and when your application got focus again it starts updating the Label with the current time ?

     

    If you can provide us with the code that updates your Label , That would be better to know what is the reason of this issue.

    What is your Windows Mobile Type and Version in this project ?

    What is your .NetCF you are using in this project ?

     

    These two videos talking about using code friendly to battery power , you can take a look if you are using the same technique.

    Preserve Battery Power When My Application is in the Background?

    Programmatically Monitor for a Specific Time of Day Without Draining a Device Battery?

     

    Let us know if that helps.

    Regards : MrAlshahawy

     


    Please remember to mark the replies as answers if they help ,Don't forget to Vote the answer as Helpful if it helps
    Wednesday, May 5, 2010 5:58 AM
  • Your post got me thinking and made me do some more research since I'm new to Windows Mobile Development.

    I found that the app itself is NOT shutting off, but the GPS is. I've found a lot of posts about this dealing with power management etc. Trying to keep the gps updating is not an easy thing apparently.

    I'm going to keep researching and will post back if I need further help. Thanks for your help and gettign me in the right direction.

    Wednesday, May 5, 2010 6:04 PM
  • Ok I still need help on this issue as I've exhausted pretty much every resource.

    I'm using an HTC Ozone, windows mobile 6.1. My managed app (c#) continues working, but when phone "sleeps" ?? (backlight turns completely off) the GPS stops updating. Application internal timer keeps firing, but I need GPS to keep going.

    I've done the following to remedy this :

    Set teh following registry keys to the indicated value (All string values Is this correct?)

    In HKEY_LOCAL_MACHINE\SOFTWARE\HTC\SUPL AGPS

    EnableAGPS = 0 (Default is 1)

    EnableGPSSmartMode = 0 (Default is 1)

    GPSMode = 1 (default is 2)

    In the code I have the following to try to keep the thing turned on.

    A call to PowerPolicyNotify(PPN_UNATTENDEDMODE, true);

    A call to SetPowerRequirement("gpd0:", CedevicePowerStateState.DO, POWER_NAME | POWER_FORCE, NULL, 0) which returns a good handle

    And a timer which now calls SystemIdleTimerReset()

    I'm playing with the sample GPS Location application that comes with the windows mobile SDK.

    Any help would be greatly appreciated before I pull out what little hair I have left. :)

     

    Wednesday, May 5, 2010 6:52 PM
  • Hi Ken ,

    You may find the answer to your question in these posts :

    Keeping your app and GPS running receiver when the device is suspended

    Is it possible to keep a device GPS active while it is in a suspended status?

    Application Lifecycle & Background Task

    Prevent standby/keep app running in standby

    Let me know if that helps

    Regards :MrAlshahawy


    Please remember to mark the replies as answers if they help ,Don't forget to Vote the answer as Helpful if it helps
    • Marked as answer by warrentang Monday, May 10, 2010 3:51 AM
    Thursday, May 6, 2010 5:21 PM