1

I had a method which runs the timer and displays alert for every 10 minutes. But when I came out of the application it stops the timer and the it does not display any alert.

Would somebody tell me how to run the timer on background which always runs and gives the regular updates even if I'm not using the app.

Is there a way to do that? I read that the windows phone 8 will run tasks on background but I don't find how to work with it,

I saw the Scheduled Agents but I don't understand how to use that for this scenario.

rahulroy9202
  • 2,730
  • 3
  • 32
  • 45
Gopinath Perumal
  • 2,258
  • 3
  • 28
  • 41

2 Answers2

2

Scheduled agents only run every 30 minutes anyway (in the best case scenario). See Justin's answer on a very similar question for a list of your options with links to MSDN.

Community
  • 1
  • 1
Paul Annetts
  • 9,554
  • 1
  • 27
  • 43
  • can we run a timer on SheduledAgent Oninvoke method? – ggsmartboy Jan 23 '13 at 09:33
  • MSDN says "Periodic agents typically run for 25 seconds. There are other constraints that may cause an agent to be terminated early." So, at most you'd get 25 seconds every 30 minutes of the timer working. And you can't predict when that 25 seconds will be. http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202942%28v=vs.105%29.aspx. – Paul Annetts Jan 23 '13 at 09:56
0

I would look into "Reminders". If you are worried about the consistency of when it will fire, I think it would be your best bet.

Here is the MSDN article on alarms/reminders:

http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202946(v=vs.105).aspx

HarryM
  • 274
  • 2
  • 11