February 2011

Volume 26 Number 02

Toolbox - Windows Phone 7 Development Tools and Resources

By Terrence Dorsey | February 2011

Terrence DorseyWithout a doubt, one of the hottest areas for development these days is mobile apps. The smartphone market is expected to grow by 55 percent in the next year alone.

Last year, Microsoft dove back into the mobile device fray with the Windows Phone 7 platform. For the consumer, Windows Phone 7 offers a modern multi-touch interface, integration with e-mail, Facebook and Zune services, and the ability to install apps to have fun or get work done. For the developer, Windows Phone 7 provides a straightforward programming target based on Silverlight and the Microsoft .NET Framework, along with the ability to reach a large—and growing—audience of customers.

Sounds like a no-brainer, right?

We’ve already shown you a few useful tips for Windows Phone 7 programming in the pages of MSDN Magazine, but here’s a concise guide to some of the tools and information you’ll need to get started and create useful, polished apps.

At the sound of the tone, it’s time to get coding ...

Windows Phone Developer Tools

The basic tools you’ll need to start writing code for Windows Phone 7 are Visual Studio 2010 and Windows Phone Developer Tools (microsoft.com/express/Phone).

The developer tools include Visual Studio 2010 Express for Windows Phone, the Windows Phone Emulator, Silverlight for Windows Phone, XNA Game Studio 4.0 and Expression Blend 4 for Windows Phone. If you already have Visual Studio 2010, XNA Game Studio or Expression Blend 4 installed, the developer tools will just update the applications with templates and other elements you need for Windows Phone development.

Once you have the tools installed, start browsing through the MSDN Windows Phone Development documentation (bit.ly/fSYt8d). This is a crucial resource that you’ll come back to again and again. Add it to your favorites today.

App Hub

Next, head over to the Microsoft App Hub (create.msdn.com) and set up your account. App Hub is a community for developers of apps and games for Windows Phone 7 or games for Xbox 360. You can find tools, advice and the support of fellow app developers here. Plus, you’ll use the App Hub dashboard as the official tool for submitting your apps for the Windows Phone marketplace.

To register for App Hub you’ll need a Windows Live ID, and there’s a yearly $99 fee for membership.

image: App Hub

Figure 1 App Hub

Visual Basic Development

The first tools for Windows Phone development focused on C# as the coding language. But if you prefer Visual Basic, don’t fret. The Visual Studio team has released Visual Basic for Windows Phone Developer Tools (bit.ly/haiyqH), which allows you to dive right in.

The team announcement even includes a tutorial for creating your first Visual Basic app for Windows Phone 7, walking you through the development of a simple tip-calculator app. No excuses now—get coding!

Windows Phone 7 for Absolute Beginners

Still not sure what to do next? Get yourself over to Channel 9 and check out the “Windows Phone 7 Development for Absolute Beginners” video series (bit.ly/fZJSqC). Clint Rutkus and Bob Tabor (from LearnVisualStudio.net) guide you through this series of 65 short videos covering everything from platform basics to debugging and error handling. You’ll even dive into details such as using the GPS capabilities of Windows Phone 7 devices.

XPF: A Layout Framework for XNA

General UI design and composition on Windows Phone 7 utilizes Windows Presentation Foundation (WPF) and Silverlight. But if you’re building games for the phone platform, you’re most likely going to be using XNA Game Studio (msdn.microsoft.com/aa937791), which uses a different layout architecture.

To simplify design under XNA, Red Badger has created XPF, a layout framework for creating Windows and Windows Phone 7 apps with XNA. The XPF framework runs in a pure XNA application, yet was written to be familiar to WPF and Silverlight developers. There are 11 built-in controls, along with support for dependency properties, attached properties, animation and data binding. Plus, XPF is extensible to accommodate your own custom controls.

It’s also worth taking a look through the Red Badger blog for additional tips and tricks for building and testing your Windows Phone 7 applications (red-badger.com/Blog/?tag=/wp7).

image: Windows Phone 7 for Absolute Beginners

Figure 2 Windows Phone 7 for Absolute Beginners

Free Charles Petzold eBook

Our own Charles Petzold (bit.ly/enl2dg), along with the Windows Phone 7 team, wrote the aptly titled “Programming Windows Phone 7” (bit.ly/foFbvZ). As you’d expect from the guy who wrote five editions of the seminal “Programming Windows” (Microsoft Press, 1998), this tome is extensive and definitive. The best part? It’s free. Download the book in PDF format along with all of the sample code. For ongoing discussion of the book and Windows Phone 7 development issues, read Petzold’s blog as well (charlespetzold.com/blog/blog.xml).

And next time someone asks you a Windows Phone programming question, you can still tell them: “Look it up in Petzold.”

image: cover: Programming Windows Phone 7 eBook

Programming Windows Phone 7 eBook

31 Days of Windows Phone 7

In the same vein as the Channel 9 videos mentioned earlier, Microsoft developer evangelist Jeff Blankenburg blogged “31 Days of Windows Phone 7” (bit.ly/dJ0u8k), writing a post every day in October 2010 that covers a different aspect of coding for Windows Phone 7. Blankenburg starts with the basic project template and works through topics including storage, UI controls, debugging, and even submitting your app to the Windows Phone Marketplace and integrating ads into your app.

Blankenburg’s blog is full of other Silverlight and Windows Phone 7 development tips, and the 31 Days posts have been translated into Russian and Spanish.

Helpful Client Frameworks

Frameworks can really take a lot of the hassle out of building infrastructure or adding specific functionality to your application. Two of the more popular client frameworks for Windows Phone 7 on CodePlex are Caliburn Micro and nRoute.

Caliburn Micro (caliburnmicro.codeplex.com) is a small-yet-powerful implementation of the Caliburn (caliburn.codeplex.com) framework for Silverlight, Windows Phone 7 and WPF. These frameworks are designed to help you build application UIs quickly and easily using the Model-View-Controller (MVC), Model-View-Presenter (MVP), Model-View-ViewModel (MVVM) and Application Controller patterns.

Caliburn Micro has an active community providing information, support and examples. Get started by checking out the “Caliburn.Micro Soup to Nuts” series of posts on devlicio.us (bit.ly/hLT7lL) to follow the creation of a simple Silverlight application, starting with the basics of getting Caliburn Micro from the repository.

nRoute (nroute.codeplex.com) is another client framework for Silverlight, Windows Phone 7 and WPF that lets you build apps using the MVVM pattern.

More Tips and Tricks

One of the great side effects of the Windows Phone 7 platform has been the outpouring of shared information from members of the development community.

You’ll find everything from getting-started guides to tips for handling specific development tasks, and even ways to run other languages on the phone. Here’s what we think are some of the best posts out there:

MobiForge

Introduction to Windows Phone 7 Development Series

bit.ly/gmygUR

IE for Windows Phone Team Weblog

Targeting Mobile-Optimized CSS at Windows Phone 7

bit.ly/h5ZJwY

Ivo Manolov

Registering Your WP7 as a Developer Device

bit.ly/exSPzi

Kevin Marshall

WP7 Development Tips Part 1

bit.ly/fTcljh

Mike Ormond

Windows Phone 7 Screen Capture

bit.ly/hSraKE

MSDN Magazine

IronRuby on Windows Phone

bit.ly/gA5x7J


Terrence Dorseyis the technical editor of MSDN Magazine*. You can read his blog at terrencedorsey.com or follow him on Twitter: @tpdorsey.*

Thanks to the following technical experts for reviewing this article: Luke Nyswonger, Joshua Partlow, Brendan Mitchell, Orville McDonald