David

  • About Me
  • GoGetter for Windows Phone 7
  • My Etsy Shop
  • Random
  • Archive
  • RSS
  • Ask me anything

Generic agents for Windows Phone 7 (overview)

I am learning about generic agents in Windows Phone 7. I thought I would share what type of agents are available for Windows Phone.

Generic agents enables you to run custom code at regular intervals in the background of an app. There is a 1:1 ratio of an app and a generic agent. Each app has only 1 agent.

Code that needs to be run in the background lives in an agent which is a separate library (.dll file that contains the code to run in the background) that is associated with the foreground app.

The OS installs, stores, and updates the agent and foreground app together. The background agent is created and registered in the foreground app.

There are two types of scheduled tasks. That is a periodic task, and a resource intensive task that we can create in our foreground app.

Period tasks runs agent code every 30 minutes for 15 seconds. Each time the task is run the associated code gets executed in the background.

Resource intensive tasks only runs if and when the phone is in a state that power, network and processing resources are readily available (night stand mode):

  • connected to an external power instead of the battery
  • wifi is available, instead of cellular
  • the battery is at least 90% charged
  • lock screen is on
  • and there active phone call

The phone will run the task for up to 10 minutes. This will allow the phone to perform some extensive data syncing, uploading, downloading scenarios. 

The background agent can be assigned as a periodic task, resource intensive task, or both (This will allow the phone to run tasks every 30 minutes for 15 seconds and when in night stand mode, when the above conditions are met, for 10 minutes)

I will post some sample code soon.

    • #generic agents
    • #agents
    • #windows phone
    • #Windows Phone 7
    • #windowsphone
  • 4 months ago
  • Comments
  • Permalink
  • Share

Logo

Portrait/Logo

I created an awesome "Getting Things Done" app and I make awesome art.

GoGetter for Windows Phone 7: www.gogetterapp.com
Etsy Shop: davidrodriguez.etsy.com

Me, Elsewhere

  • @davidrodriguez on Twitter
  • Facebook Profile
  • davidarodriguez on Flickr
  • iimmerse on Last.fm
  • My Skype Info
  • Linkedin Profile

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile

© 2011 David A. Rodriguez. Effector Theme by Carlo Franco.

Powered by Tumblr