Thursday, December 20, 2012

Differences between ScheduledTaskAgent for Windows Phone 8 and 7.1

Differences between ScheduledTaskAgent for Windows Phone 8 and 7.1

I have a big problem.

I wrote an app for Windows Phone 7.1+, and it's also published on Windows Phone Store: this app works well for Windows Phone 7.1 and also for Windows Phone 8, and there were no problems during app submission process (who also declares that my app is fully compatible with any OS since Windows Phone 7.5).

The problem is related only to my Scheduled Agent, which runs perfectly on Windows Phone Mango (7.1), but it is not firing at all on Windows Phone 8 (I've also tested my app on real devices, with both the OS').

When I upgraded to Visual Studio 2012 (Express for Windows Phone), I've noticed that it is possibile to add two different types of ScheduledTaskAgent project: one for Windows Phone 7.5 and one for Windows Phone 8 (obviously it wasn't so in Visual Studio 2010...and I used the only one available = the first) !

  1. Dou you think this can be the reason while the scheduled agent is not working in WP8?
  2. What's the difference between the two projects types?
  3. How to manage (in code I mean) two projects of that type? Is it possible?
  4. How can I choose which task I have to register (see code below)?
  5. Will the submission process fail with two ScheduledTaskAgent projects (I think so)?

This is the critical part of the code, when I'm registering my task at startup:

PeriodicTask newTask = new PeriodicTask("MyTaskID");  newTask.Description = "my Description";  ScheduledActionService.Add(newTask);  #if DEBUG Microsoft.Phone.Scheduler.ScheduledActionService.LaunchForTest("MyTaskID", TimeSpan.FromSeconds(5)); 

No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog