MOBILE

Building Your First Windows Phone 7 Application (part 1) - Creating a Windows Phone Project

1/16/2011 9:22:42 AM

Preparing Your Development Machine

At the time of writing this book, Windows Phone 7 developer tool beta version 1.0 was used. The latest Windows Phone developer tool can be downloaded from http://developer.windowsphone.com/windows-phone-7/. The Windows Phone developer beta tools (vm_web.exe) will install the following:

  • Any commercial version of Visual Studio 2010 or free version of Visual Studio 2010 Express for Windows Phone: Programmer's development IDE.

  • Windows Phone emulator: Used to run and test the Windows Phone application.

  • Silverlight for Windows Phone: Silverlight Framework for Windows Phone based on Silverlight 3 technology.

  • Microsoft Expression Blend for Windows Phone: Can be used to design user interfaces.

  • XNA Game Studio 4: Tools for developing games.

In this section, you'll build a simple "HelloWorld" application using Silverlight framework. Creating the application will provide you with an opportunity to use Visual Studio 2010 Express for Windows Phone, the Windows Phone 7 Emulator, and some Windows Phone Silverlight controls.

1. Creating a Windows Phone Project

To get started, you first fire up Visual Studio Express 2010 and create a project.

  1. To launch Visual Studio 2010 Express, select Windows Start => All Programs =>Microsoft Visual Studio 2010 Express => Microsoft Visual Studio 2010 Express for Windows Phone.

  2. Create a new project by selecting File => New => Project on the Visual Studio menu, as shown in Figure 1.

    Figure 1. Creating a new project
  3. From among the three C# templates that Visual Studio displays on its New Project dialog page, select the Windows Phone Application Visual C# template, as shown in Figure 2.

    NOTE

    There are three different Windows Phone Visual Studio project templates. The Windows Phone Application template is a template for one-page applications. The Windows Phone List Application template uses ListBox control and page navigation framework to create applications with multiple pages. The Windows Phone Class Library template can be used to create a class library that can be referenced by other Windows Phone projects.

  4. For the purposes of this exercise, change the Name of the new project to "HelloWorld," by changing the text in the Name box, as shown in Figure 2. Also you can change the location where the project will be saved by changing the path in the Location box.

    Figure 2. Creating a new Silverlight Windows Phone application
  5. Finally, select OK on the New Project dialog, and Visual Studio 2010 will build your project, whose elements are displayed in Figure 3.

Figure 3. HelloWorld Silverlight Windows Phone project

By default two TextBlock controls will be placed in Windows Phone, and you can see this in design view on the far left in Figure 3.

With a phone project ready to roll, it's time to bring the application to life by adding some functionality and creating a user interface. We'll start with the interface, adding some controls to its blank design surface for users to press and in which the application can display text.

Other  
  •  Introducing Windows Phone 7 and the Windows Phone Platform
  •  Windows Phone Application Platform
  •  iPhone Application Development : Basic User Input and Output
  •  Mobile Phone Game Programming : A Quick J2ME Primer
  •  Mobile Phone Game Programming : Java As a Mobile Game Platform
  •  Mobile Phone Game Programming : Getting to Know Mobile Platforms
  •  Mobile Application Security : The Apple iPhone - Local Data Storage: Files, Permissions, and Encryption
  •  Mobile Application Security : The Apple iPhone - Permissions and User Controls
  •  iPhone Application Developmen : Using the View-Based Application Template (part 3)
  •  iPhone Application Developmen : Using the View-Based Application Template (part 2) - Preparing the View Controller Outlets and Actions
  •  iPhone Application Developmen : Using the View-Based Application Template (part 1)
  •  Mobile Application Security: Application Format
  •  Mobile Application Security: Security Testing
  •  Mobile Application Security: The Apple iPhone - Development
  •  Building Android Apps : Installing KiloGap in the Emulator
  •  Building Android Apps : Build KiloGap
  •  Building Android Apps: Create an Android Virtual Device
  •  Building Android Apps: Going Native - Setting Up the Environment
  •  Building Android Apps: Introduction to PhoneGap
  •  iPhone Application Development : How Xcode and Interface Builder Implement MVC
  •  
    Top 10
    A Look At Truecrypt The Open Source Security Tool
    Price Of Piracy
    Acer Aspire 5600U 23" Touchscreen All-in-One PC
    Zalman FX100-Cube Fanless Cooler
    Devolo dLAN LiveCam Starter Kit
    Has Apple Lost It? (Part 2)
    Has Apple Lost It? (Part 1)
    Sony Computer Entertainment (Part 3)
    Sony Computer Entertainment (Part 2)
    Sony Computer Entertainment (Part 1)
    Most View
    Incoming: Corsair, OCZ, Crucial, nVidia
    Port-Binding Shellcode
    Nikon Coolpix L310 - Bridge Camera With Some Semi-Pro Specs
    Windows Vista : Customizing Windows PE Boot Images (part 2) - Working with an ImageX GUI, Working with PEImg
    Mobile Applications Guide - November 2012
    How To Build Your Own PC From Scratch (Part 4)
    Huge Screen Supertest (Part 5) - ASUS PA238Q & ASUS VG278H
    Programming COM+ Security (part 2) - Creating the Serviced Component, Specifying the COM+ Application Type
    Windows Server 2003 : Securing and Troubleshooting Authentication
    Sony KD-84X9005 - Sony’s First 4K TV
    SQL Server 2008 : Advanced Stored Procedure Programming and Optimization - Using Dynamic SQL in Stored Procedures
    Top 10 Televisions – Jan 2013
    How Secure Is Your Pin? (Part 2)
    Installing Windows Small Business Server 2011 (part 2) - Understanding the Installation Process
    Primo GTX 660 Windows 8 Edition - Deliciously Ironic
    Toshiba STOR.E Edition 500GB
    Samsung Galaxy Note II In-Depth Review (Part 5)
    Algorithms for Compiler Design: THE LR PARSER
    Searching for Google’s future (Part 3) - Gene genie
    The Connected BlackBerry : Connection Paths (part 1) - Wireless Application Protocol Connection, Direct TCP Internet Connection, BlackBerry Internet Service Connection