Windows Phone 7 supports “smart” multitasking, which means that third party applications have to manage their own state and cannot run in the background (except for some apps which can play music under a locked screen, although this is really a function of the first-party software on the phone).
That leaves some folks confused: How can I run a “service” type application on the phone?
The answer is that you really can’t. And this answer has many developers heading for the cloud.
Now, ultimately I think this is a good thing. Say you have an app that polls stocks. Instead of sitting there on your phone, draining your battery, the app could be running in the cloud, on a machine plugged into a wall somewhere that has comparatively infinite resources. Whenever that stock goes “bing,” the phone gets a notification and launches the app. That’s a pretty clean way of doing it and leaves you with more precious battery life!
Over the next few blog posts, we’ll explore some of the uncharted vapors of the cloud and how we can utilize them to take your Windows Phone apps to the next level.
Here is the tentative agenda (I’ll be updating this as we move):
1) Intro (this post!)
2) App Data: SQL Azure
3) The Cloud Service: Registering for Push Notifications (via WCF endpoint)
4) The Cloud Service: Worker Role
5) Writing the Phone App
We will be building a very simple app that watches a few stocks for a user and occasionally alerts that user when a stock changes by some threshold. Easy, right? You’ll be amazed to see all the pieces of Microsoft we touch during this journey.
Join me tomorrow to read about SQL Azure and see how to set up a database using the new management portal (formerly Project Houston).