Over a million developers have joined DZone.

Understanding the WP7.1 Periodic Agents API

DZone's Guide to

Understanding the WP7.1 Periodic Agents API

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

There are plenty of new APIs out in the new 7.1 version of the Windows Phone OS, and developers are still learning how to use each one properly and to its fullest extent.  Scott Wildermuth blogged recently on the Periodic Agents API and then posted a follow up blog when he was getting some confusing feedback:

It seems that developers are confused about the role periodic agents have with their apps. The short version of the story is that periodic agents are supposed to support your app, not replace it. To this end a periodic agent must be re-registered at least every fourteen days. Typically this is accomplished by re-registering your app on every startup.  So I am curious as to whether people are building apps they think only have background agent functionality.  --Scott Wildermuth

Wildermuth says he's confused as to why anyone would run the API from published applications and shows you how to remove the need to ever do this:

The trick is to put the code you need to launch from both places in a shared library. For example, you can see here a Windows Phone 7 application in Visual Studio’s Solution Explorer:

You can get the full picture at his blog post: http://wildermuth.com/2011/10/15/Confusion_Around_WP7_1_Periodic_Agents

Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}