locked
Is this a doable scenario (run app i background, local toast notifications)? RRS feed

  • Question

  • Hello
    I have an soccer app that when it is running it polls sports data every 5 minutes from the web. If any result has changed, since last time the app checked, there is a sound playing along with some text in the app.


    So my questions are:

    1. Will my app be able to run in the background (while I do other things on my phone) with Mango and still poll the results every 5 minutes? Will the sound play even if it runs in the background?

    2. Is it possible to have my app send a local toast notification (without any push functionality) if any of the results changes while the app is running in the background?


    Would really appreciate some help here. Thanks in advance!
    Saturday, August 20, 2011 1:57 PM

Answers

  • 1. Will my app be able to run in the background

    yes, either as a Background Task or "runs under screen lock"

    However...
    (while I do other things on my phone) with Mango and still poll the results every 5 minutes?

    No, the PeriodicTask runs every 30 minutes (or so)  You would have to run only under screen lock to get a 5 minute interval, but you lose the ability to do other things at the same time.

    Will the sound play even if it runs in the background?

    You can use a toast notification to play a sound, or use an audio background task to play sounds in the background.

    2. Is it possible to have my app send a local toast notification (without any push functionality) if any of the results changes while the app is running in the background?

    Yes, every 30 minutes or so.  Just send the toast from your PeriodicTask.
    Tuesday, August 23, 2011 7:25 PM

All replies

  • 1. Will my app be able to run in the background

    yes, either as a Background Task or "runs under screen lock"

    However...
    (while I do other things on my phone) with Mango and still poll the results every 5 minutes?

    No, the PeriodicTask runs every 30 minutes (or so)  You would have to run only under screen lock to get a 5 minute interval, but you lose the ability to do other things at the same time.

    Will the sound play even if it runs in the background?

    You can use a toast notification to play a sound, or use an audio background task to play sounds in the background.

    2. Is it possible to have my app send a local toast notification (without any push functionality) if any of the results changes while the app is running in the background?

    Yes, every 30 minutes or so.  Just send the toast from your PeriodicTask.
    Tuesday, August 23, 2011 7:25 PM
  • Thank you for your help, explained it all. Too bad I can't do it the way I initially planned it.
    Friday, September 2, 2011 11:54 AM