RunAppAtEvent, RunAppAtTime

Discussion in 'Questions (Windows Mobile)' started by sahoopes, Apr 5, 2008.

  1. sahoopes

    sahoopes Member Licensed User

    RunAppAtEvent, RunAppAtTime - Anyone REALLY got it working?

    RunAppAtEvent, RunAppAtTime

    Anyone have a completed project that utlizes these methods sucessfully? I've tried several different ways and nothing is consistent.

    For example, I use the RunAppAtEvent with the WakeUp event which should trigger my app at power on but as soon as my device goes to sleep or I press the power button, the app is triggered.

    When I use RunAppAtTime my app is triggered but if the device is asleep at trigger if starts the app and then nothing. I cannot use ScreenOn apparently because that generates an error. So since code does not run when device is asleep the app just starts and then waits forever.

    I even tried using a little helper app that runs in background instead of using the notifications. With the helper app I tried both timer and sleep to wait for the time to start my project but as soon as the device sleeps the helper app is dead also.
     
    Last edited: Apr 17, 2008
  2. Erel

    Erel Administrator Staff Member Licensed User

    Not all devices support these methods.
    I didn't understand the problem you encounter with RunAppAtEvent.

    You can't run any code while the device is suspended (OS design).
    You can prevent a device from suspending with the Hardware library.
     
  3. sahoopes

    sahoopes Member Licensed User

    RunAppAtEvent

    I'm using a HTC Kaiser (AKA AT&T Tilt) with stock Windows Mobile 6.0 ROM.

    I tried to write a simple scheduler to schedule apps to run. In order for this to work the device must wake up even after hours of sitting when it will probably be asleep. Not sure why my device does not allow Hardware.ScreenOn but OK.

    But when I use Hardware.RunAppAtEvent(anyapp,Hardware.evWakeUp) the event is triggered as soon as it powers off either after time elapses or I press the power button.

    Since I was never able to get all these Hardware methods to work correctly I was hoping someone had a fully-functional example of an app that sets these notifications and closes and then comes back at the correct notification or time event as expected.
     
  4. sahoopes

    sahoopes Member Licensed User

    [BUMP]
    Anyone have a fully-functional example of an app that sets these notifications and closes and then comes back at the correct notification or time event as expected?
     
  5. JJM

    JJM Active Member Licensed User

    Hello,

    I have the same problem with my HP Ipac 2490 (and also with the option BluetoothMode).

    It will be a good idea to write a list of the devices which accept these commands.

    Bye
    JJM
     
  6. sahoopes

    sahoopes Member Licensed User

    Look slike I've come across another developer having a similar problem.

    From http://forum.xda-developers.com/showthread.php?t=387263

     
Loading...