Writing Your First Windows Phone 8 Application
- Preparing Your Machine
- Creating a New Project
- Designing with Blend
- Adding Code
- Working with the Phone
- Where Are We?
Read Essential Windows Phone 8, Second Edition and more than 24,000 other books and videos on Safari Books Online. Start a free trial today.
While the press might have you believe that becoming a phone-app millionaire is a common occurrence, it’s actually pretty rare, but that doesn’t mean you won’t want to create applications for the phone. Hopefully the days of cheap and useless but popular phone apps are over, and we can start focusing on phone-app development as being a way to create great experiences for small and large audiences. Microsoft’s vision of three screens is becoming a reality, as the phone is joining the desktop and the TV as another vehicle for you to create immersive experiences for users.
Although understanding Windows Phone capabilities and services is a good start, you are probably here to write applications. With that in mind, this chapter will walk you through setting up a machine for authoring your very first Windows Phone application.
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 2.1.
TABLE 2.1. Windows Phone Developer Tools Requirements
Requirement |
Description |
Operating system |
Windows 7, x86 or x64 (all but Starter Edition); or Windows Vista SP2, x86, or x64 (all but Starter Edition). |
Memory |
3GB RAM. |
Disk space |
4GB free space. |
Graphics card |
DirectX 10-capable card with a WDDM 1.1 driver. |
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 because the emulator has steeper requirements than the SDK itself. These requirements are shown in Table 2.2.
TABLE 2.2. Windows Phone Developer Tools Requirements
Requirement |
Description |
Operating system |
Windows 8 Professional, 64-bit version |
Memory |
4GB RAM |
Hyper-V |
Installed and running |
BIOS settings |
Hardware Assisted Virtualization, Secondary Level Address Translation (SLAT) and Data Execution Protection (DEP) all enabled |
Group membership |
Must be member of both local Administrator and Hyper-V Administrator groups |
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 (that is, Expression Blend).