To Do: Create an Azure-integrated Windows 7 Phone App

Trying to simultaneously tackle a phone app, a web app, and a native Windows app is a little intimidating the first time. Larry O'Brien shows you how surprisingly easy this task becomes with Visual Studio 2010 and .NET technologies. 

The cloud wants smart devices. It also wants Web access, and native applications that take advantage of the unique capabilities of user's laptops and desktop machines. The cloud wants much of us.

Get Started

Windows Phone 7 Marketplace

Get Windows Phone 7 Developer Toolkit

MSDN Video: The Power of the Cloud — Exploring Windows Phone 7 Services

Join the App Hub Community of App and Game Developers!

Once upon a time, the rush was on to produce native Windows applications, then it became "you need a web strategy", and then "you need a mobile strategy". Therefore it is natural to sigh and try to ignore it when told "you need a cloud strategy". However, one of the great advantages of Microsoft's development technologies is their integration across a wide range of devices connected to the cloud: phones and ultra-portable devices, laptops, desktops, servers, and scale-on-demand datacenters. For storage, you can use either the familiar relational DB technology that SQL Azure offers, or the very scalable but straightforward Azure Table Storage capability. For your user interfaces, if you write in XAML you can target WPF for Windows or Silverlight for the broadest array of devices. And for your code, you can use modern languages like C# and, shortly, Visual Basic.

Trying to simultaneously tackle a phone app, a web app, and a native Windows app is a little intimidating the first time, but the surprising thing is how easy this task becomes with Visual Studio 2010 and .NET technologies.

In this article, we don't want to get distracted by a complex domain, so we're going to focus on a simple yet functional "To Do" list manager. Figure 1 shows our initial sketch for the phone UI, using the Panorama control. Ultimately, this To Do list could be accessed not only by Windows Phone 7, but also by a browser-based app, a native or Silverlight-based local app, or even an app written in a different language (via Azure Table Storage's REST support).

Figure 1.

Enterprise developers may be taken aback when they learn that Windows Phone 7 does not yet have a Microsoft-produced relational database. While there are several 3rd party databases that can be used, those expecting to use SQL Server Compact edition are going to be disappointed.

Having said this, you can access and edit data stored in Windows Azure from Windows Phone 7. This is exactly what this article is going to concentrate on: creating an editable Windows Azure Table Storage service that works with a Windows Phone 7 application.

Windows Phone 7 Developer Program
Join the Windows Phone 7 Developer Program today! It's free and gives you access to expert technical support, marketing benefits, and a $99 Marketplace rebate if you develop two or more apps.

Installing the Tools
You will need to install the latest Windows Phone Developer Tools (this article is based on the September 2010 Release-To-Manufactures drop) and Windows Azure tools. Installation for both is very easy from within the Visual Studio 2010 environment: the first time you go to create a project of that type, you will be prompted to install the tools.

Download the OData Client Library for Windows Phone 7 Series CTP. At the time of writing, this CTP is dated from Spring of 2010, but the included version of the System.Data.Services.Client assembly works with the final bits of the Windows Phone 7 SDK, so all is well.

You do not need to run Visual Studio 2010 with elevated permissions for Windows Phone 7 development, but in order to run and debug Azure services locally, you need to run Visual Studio 2010 as Administrator. So, although you should normally run Visual Studio 2010 with lower permissions, you might want to just run it as Admin for this entire project. The Windows Phone 7 SDK does not support edit-and-continue, so you might want to turn that off as well.

While you are installing these components, you might as well also add the Silverlight for Windows Phone Toolkit. This toolkit provides some nice controls, but it is especially useful because it provides GestureService and GestureListener classes that make gesture support drop-dead simple.

Since Windows Phone 7 applications are programmed using Silverlight (or XNA, for 3-D simulations and advanced gaming) we naturally will use the Model-View-ViewModel (MVVM) pattern for structuring our phone application. So let's start by creating a simple Windows Phone 7 application.

More from Microsoft

Microsoft Platform Ready   *   msdev   *   msdev facebook   *   WP7 Phone dev program
  Next Page: Hello, Phone!
Trials and Tools

Building a Windows Phone Client to a RESTful WCF Service

Learn how to use Azure tables and a web role for a simple RESTful WCF service that returns JSON and is easily consumable by a Windows Phone client.

Scott Guthrie Discusses Windows Azure

Scott Guthrie talks about what he's been focused on with Windows Azure. Scott talks about the good, the bad, and the ugly, and also shows code along the way.

Deploying the Cloud Ready Packages for Devices

Discover how easy it is to deploy this package to Windows Azure regardless of your operating system (e.g. Windows 7 or OSX) and target device (e.g. Windows Phone 7, iOS, or Android).

Tankster and the Windows Azure Toolkit for Social Games

Steve and Wade talk about the newly released Windows Azure Toolkit for Social Games. The toolkit enables unique capabilities for social gaming…

An Introduction to Service Bus Topics

Discover how to build flexible messaging solutions with the Service Bus Topics within Windows Azure AppFabric.

Develop Applications for Impact

Windows Azure means that your developers can deliver a new kind of value to your business. Scott Guthrie talks about how to kick the tires on Azure today.

SQL Azure At a Glance

This walkthrough takes a high-level look at the numerous benefits and usage scenarios of SQL Azure. The video highlights the many ways SQL Azure services can be used to create and share cloud powered applications.