WP7: Background execution – revisited!

The dust from what was presented at Mix11 has long settled and the mango released had been packaged. The tools are with us and we are just waiting for the update to officially reach the phones. So I will do a quick view on background execution in the light of a post I did a few months ago: WP7: Background execution – really?

As it turns out I wasn’t that far from what was presented. Lets go through each point.

The audio service first

What I said around audio service was to make use of:

…the Zune media player. Why would I want to create a new player over and over again? Wouldn’t it be better to integrate with the current? If the API was richer…

It’s just what they provided for us. They call it the Zune service and it’s very easy to use as well. You need of course create a background player agent that is entitled to continue feeding the audio service with tracks to play. The metadata is fully controllable as well using the AudioTrack class that holds lots of information like:

  • Title
  • Artist
  • Album       
  • Tag
  • Duration
  • AlbumArt
  • Source
  • PlayerControls

And as an added bonus it can even be controlled from the web. It will be possible to build an audio player in HTML5 that continues to play the music in the background. Nicely done!

GPS application

My suggestion was to just start the GPS service and start tracking the point in a cache so that not only the current application would access the GPS but also let other application using it at the same time. Also there should be a possibility to trigger a background task on events like each kilometer or every 5 minutes. As we know now, these ideas wasn’t realized in the current version so for RunKeeper and applications like it. It’s still run under screen lock that is the solution.

There are some traces of tracking if you look a bit deeper and do a few undocumented calls. But it’s nothing that is official and an application using it probably wont make it through to marketplace. However, it might very well hint on upcoming functionality and official APIs.

Task scheduling

I also suggested something along these lines of operation:

Why not support some kind of task scheduling instead of true background operation.

Well I missed the naming of this functionality, I should call the code snippets brought back to life agents and I would be spot on. The only exception is the rate of how the agents are run.


In all I think they mostly managed to live up to the users and developers needs here. And now with the mango release fully on its way to the windows phone out there and upcoming models it will certainly be a a lot of fun. 

Leave a Reply