Stop Hatin’ the Scheduled Agents ! ;)

Fellow WP devs, stop hatin’ the Scheduled Agents in Windows Phone ! xD If you are suffocating from a weird bug for a long time, its prolly not a Framework’s fault, but could be a minor mistake in your code thats is causing the whole mess. It is because Background Scheduled executions on WP is highly restricted and limited, whereas it throws exceptions even for the slightest glitch screwing up the entire thread circle, by interrupting NotifyComplete(); ! O.o
Bottom line, I too hate their stupid restricted Scheduled executions because they are so restricted, but gotta deal with it.. -_-  for gods sake, once only 30 minutes !😦 OH COME ONNNNNNN ! :S

Anyhow recently I came across this issue where the Scheduled Agent wasn’t firing in my apps when the app was published to the marketplace and then downloaded to the phone to use. After one or two times of execution the background agents weren’t working, so I later found out it was because of the “LaunchForTest()” method I have called inside the “OnInvoke()” method of the Background Agent. Guys this is a serious issue, most of us try to decrease the time span in a Scheduled Agent execution by using this method every time the “OnInvoke()” method fires. But this is a completely risky because it throws InvalidOperation exception ! :O

Therefore at end user level the Scheduled Agents crashes because the “NotifyComplete()” gets interrupted due to the exception that occurs as above. Because in order to complete and move on to the next thread execution circle the “NotifyComplete()” is crucial.

Check out more about this issue and the solution from below link,

Have fun Coding WP Apps !😉

2 thoughts on “Stop Hatin’ the Scheduled Agents ! ;)

  1. ScheduledActionService.LaunchForTest() is what the name suggests, its for testing only 😀 wrap it with an if (Debugger.IsAttached) and you should be good in any case.. And would’t we love if LaunchForTest() actually worked for us..;)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s