By the time you read this, the Windows Phone 7 devices will be widely available on the market. Many developers are thinking about developing for this phone. If you are thinking about it, then I suggest you do more than think and start developing! This is a whole new opportunity and a whole new market available to you as a .NET developer that you have not had before. If you held off on developing mobile applications because of the learning curve of iPhone or Android programming, then this is your chance, as you will use Silverlight and .NET to program the Windows Phone. In this short article, I will introduce you to the basics of Windows Phone and give you some reasons why you will want to develop using this important new technology.

Silverlight and .NET on the Phone

If you have been keeping up with development on .NET, then you already know XAML, Silverlight and WPF are the best ways to develop web and desktop applications today. Now you can apply your XAML knowledge to a mobile device. You can take advantage of all your existing .NET skills such as OOP, ADO.NET (Entity Framework, LINQ to SQL), LINQ queries, and Windows Communication Foundation (WCF) to create compelling applications for Windows Phone. What could be better!?

Windows Phone (WP) is based on Silverlight 3 with some things removed and some things added that are specific for the Phone. To develop applications for Windows Phone you simply need to download the WP Tools for Visual Studio 2010. These tools give you everything you need to develop using the built-in Windows Phone Emulator. If you purchase a Windows Phone device, then you will be able to test your application in a production environment.

Features Available

You can develop many different types of applications for use on the Windows Phone. You can develop business applications as well as games using XNA. To retrieve and store data, you simply need to create a WCF service that is exposed somewhere in the Cloud. WCF services are easily created using .NET and there are a whole host of articles on the web available to you to learn how to create these services.

You are allowed to interact with the built-in camera on the Windows Phone. This means you can create applications that store and manipulate those pictures. In addition you can display pictures and even video on the Windows Phone. With an 800x480 WVGA screen on the hardware you have a great surface on which to display these multi-media elements. Each WP device is also a multi-touch screen so you have all the standard touch gestures such as pan, flick, tap, stretch and pinch.

A version of Bing Maps is available to all developers on the Windows Phone. Each phone comes with GPS and location services you can use to figure out where the user is located and then display a map using the coordinates from the GPS. Or, you could use the maps to give the user directions to a place they are trying to find.

UI Design with Windows Phone

While you don’t have access to everything that you normally have in Silverlight, you do have everything you need to create great user interfaces. Figure 1 shows a list of all the standard XAML controls that are available to Windows Phone developers. You might notice a few things missing such as a ComboBox. However, all of the primitive controls are available that fit within the Microsoft UI Design Guidelines for Windows Phone. You could even make a ComboBox out of a TextBox and ListBox control if you really feel the need for one, however, you should really think about an alternate UI as opposed to using a ComboBox as this control does not really translate to the phone environment very well.

Figure 1: XAML controls available in Windows Phone 7.

Application Bar

In the design guidelines for Windows Phone 7 there is a place at the bottom of each application to put an Application Bar where you are allowed to have from 1-4 icons. Besides the icons, you can also have a series of menu items that appear when the user touches the ellipsis in the upper-right corner of the Application Bar. You are not allowed to have any more than four icons, but you can have almost as many menu items as you want. However, in practice, you should limit the number of menu items to five as this will avoid extra scrolling by the user.

When designing your icons, you need to stick with the design guidelines laid out by Microsoft. Most importantly, each icon must be 48x48 pixels. The image itself should fit within 26x26 pixels centered within the icon. The image should be a white foreground with the rest of the background set to transparent. The Application Bar will put a circle around the center of your icon so you should not attempt to put this circle in your icon. You should avoid color in your icons as they could interfere with the users’ selected theme on the phone.

Keyboards

There are many different styles of “soft keyboards” available to you to display whenever the user clicks on a text box for input. Your choices include TelephoneNumber, Text (with emoticons), and Number (displays numbers and punctuation characters only). Each of these different keyboards can be controlled by setting the InputScope attribute on each TextBox control. Using the appropriate input scope attribute will make data entry much easier for users. The code snippet below shows how easy it is to control the keyboard that displays on the phone when the user gives focus to each of the TextBox controls.

<TextBox InputScope="Text" />
<TextBox InputScope="Number" />
<TextBox InputScope="TelephoneNumber" />

Visual State Manager and Animations

People want cool transitions from application to application and even from page to page within your application. Visual State Manager and animations are an important part of the XAML in Windows Phone 7. Two application templates come with the Windows Phone 7 tools: Panorama and Pivot. Each of these will show you how to create some great transitions from one page to another. Of course, you do not need to use these - you can develop your own transitions using the Visual State Manager. You are only limited by your imagination.

Office on the Phone

Personally, the one thing I believe will almost ensure wide-spread adoption of Windows Phone 7 is that you can run PowerPoint, Word and Excel on it! An executive giving a PowerPoint presentation will not even need to carry a laptop; they can hook Windows Phone 7 to a projector and run the complete slide show from the phone! Microsoft OneNote and SharePoint Workspace Mobile are also two apps that busy executives will love using when on the go. They can sync the information on their phone when they return to the office, or whenever they are connected to a mobile network. Outlook Mobile allows you to sync not only multiple Exchange mailboxes, but will also allow you to connect your Gmail, Yahoo and other email accounts with ease.

Summary

You should really start developing for the Windows Phone device now. There are literally thousands of applications for the iPhone. There are millions of users of smart phones worldwide. If you were to develop a really killer app for a smart phone and you just charged $1 for it, this could translate into some serious cash! Since you are reading this magazine I assume you are a .NET developer already. If that is the case, then you are already half-way to developing that next great Windows Phone application. So, what are you waiting for? Get going!