IT tutorials
 
Mobile
 

Windows Phone 8 : Creating a New Project (part 1) - Visual Studio

12/12/2012 6:24:48 PM
- Windows 10 Product Activation Keys Free 2019
- How to active Windows 8 without product key
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

1. Preparing Your Machine

Before you can start writing applications for the phone, you must install the Windows Phone Developer Tools. Go to https://dev.windowsphone.com/ to download the tools called Windows Phone SDK. This website is the starting point for downloading the tools as well as accessing the forums if you have further questions about creating applications.

To install the Windows Phone SDK you must meet the minimum system requirements shown in Table 1.

Table 1. Windows Phone Developer Tools Requirements

Image

Once you meet the requirements, you can run the vm_web.exe file that you downloaded from the website to install the Windows Phone SDK. The SDK installer includes Microsoft Visual Studio 2012 Express for Windows Phone, Microsoft Blend Express for Windows Phone (the Express version of Microsoft Expression Blend), and the Software Development Kit (SDK). Visual Studio Express is the coding environment for Windows Phone. Blend Express is the design tool for phone applications. And the SDK is a set of libraries for creating phone applications and an emulator for creating applications without a device.

In addition, the Windows Phone SDK’s phone emulator has additional requirements. This is because the Windows Phone SDK for Windows Phone 8 includes an all new emulator that is a Hyper-V image (instead of the old virtual machine technology). This matters as the emulator has steeper requirements than the SDK itself. These requirements are shown in Table 2:

Table 2. Windows Phone Developer Tools Requirements

Image

Tip

The Windows Phone emulator does not work well in a virtual machine (e.g., Virtual PC, VMware, etc.) and is not officially supported. The emulator is a virtual machine of the phone, so running a virtual machine in a virtual machine tends to cause problems, especially slow performance.


Visual Studio is the primary tool for writing the code for your phone applications. Although the Windows Phone SDK installs a version of Visual Studio 2012 Express specifically for phone development, if you already have Visual Studio 2012 installed on your machine the phone tools will also be integrated into this version of Visual Studio. The workflow for writing code in both versions of Visual Studio is the same. Although both versions offer the same features for developing applications for the phone, in my examples I will be using Visual Studio Express Edition for Windows Phone. In addition, I will be using Blend Express, not the full version of Blend (i.e., Expression Blend).

2. Creating a New Project

To begin creating your first Windows Phone application you will want to start in one of two tools: Visual Studio or Expression Blend. Visual Studio is where most developers start their projects, so we will begin there, but we will also discuss how you can use both applications for different parts of the development process.

2.1 Visual Studio

When you install the Windows Phone SDK you get a version of Visual Studio 2010 Express that is used to create Windows Phone applications only. When you launch Visual Studio 2012 Express you will see the main window of the application, as shown in Figure 1.

Figure 1. Microsoft Visual Studio 2012 Express for Windows Phone

Image

Click the New Project link on the Start page and you will be prompted to start a new project. Visual Studio 2012 Express only supports creating applications for Window Phone. In the New Project dialog (see Figure 2) you will notice that only Windows Phone and XNA projects are shown. For our first project we will start with a new project using the “Windows Phone App” template and name it “HelloWorldPhone”.

Figure 2 New Project dialog

Image

When you click the OK button to create the project, Visual Studio will prompt you with a dialog where you can pick what version of the phone to target (version 7.1 or 8.0), as seen in Figure 3.

Figure 3. Picking the phone version to target

Image

Once Visual Studio creates the new project, you can take a quick tour of the user interface (as shown in Figure 4). By default, Visual Studio shows two main panes for creating your application. The first pane (labeled #1 in the figure) is the main editor surface for your application. In this pane, every edited file will appear separated with tabs as shown. By default, the MainPage.xaml file is shown when you create a new Windows Phone application; this is the main design document for your new application. The second pane (#2 in the figure) is the Solution Explorer pane and it displays the contents of the new project.

Figure 4. The Visual Studio user interface

Image

Another common pane that you will use is the toolbar, and it is collapsed when you first use Visual Studio. On the left side of the main window you will see a Toolbox tab that you can click to display the Toolbox, as shown in Figure 5.

Figure 5. Enabling the toolbar

Image

You may also want to click the pin icon to keep the toolbar shown at all times (as highlighted in Figure 5).

Before we look at how to create the application into something that is actually useful, let’s see the application working in the device. You will notice that in the toolbar (not the Toolbox) of Visual Studio there is a bar for debugging. On that toolbar is a drop-down box for specifying what to do to debug your application. This drop down should already display the words “Emulator WVGA 512MB” as that is the default when the tools are installed (as shown in Figure 6).

Figure 6. Using the emulator

Image

At this point, if you press the F5 key (or click the triangular play button on the debugging toolbar), Visual Studio will build the application and start the emulator with our new application, as shown in Figure 7.

Figure 7. The emulator

Image

This emulator will be the primary way you will debug your applications while developing applications for Windows Phone. Our application does not do anything, so you can go back to Visual Studio and click the square stop button on the debugging toolbar (or press Shift-F5) to end your debugging session. You should note that the emulator does not shut down. It is meant to stay running between debugging sessions.

 
Others
 
- Developing BlackBerry Tablet Applications : Permissions and Configuration Settings
- Developing BlackBerry Tablet Applications : Permissions
- Introducing Windows Phone 8 : The Marketplace
- Introducing Windows Phone 8 : Application Lifecycle, Driving Your Development with Services, Live Tiles
- Introducing Windows Phone 8 : Input Patterns
- Iphone Application : Using Address Book, Email, and Maps (part 4) - Using the Message UI
- Iphone Application : Using Address Book, Email, and Maps (part 3) - Using a Map Object
- Iphone Application : Using Address Book, Email, and Maps (part 2) - Accessing the Address Book
- Iphone Application : Using Address Book, Email, and Maps (part 1)
- Iphone Application : Extending Application Integration
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
programming4us programming4us
 
Popular tags
 
Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS