Android to Windows Phone 8 Part 4: Running the Windows Phone Application

April 16, 2013

Over the past several weeks I’ve been working on some content I’m excited to finally share with you through a series of blog posts. This series will introduce you to Windows Phone 8 development from an Android developer’s perspective. Through the course of the series you’ll create your first app. It won’t be anything pretty, but you’ll learn the ins and outs of the development environment, how to create a simple user interface, and how to perform navigation. Along the way you’ll see some Android Hints that will help make it easier for you to transition your existing skills to the Windows Phone platform. You’ll also see some Visual Studio Tips to make you more productive in your development environment. Good luck!

In the last lesson you explored the Windows Phone project Visual Studio created for you. Now it’s time to run and see what it looks like. There are two different ways you can run the application:

  1. In an emulator
  2. On a device

In this lesson you’ll learn how to run the application in both of these ways.

Emulator

Windows Phone Emulator is a desktop application that emulates a Windows Phone device. It provides a virtualized environment in which you can debug and test Windows Phone apps without a physical device. It also provides an isolated environment for your application prototypes.

Windows Phone Emulator is designed to provide comparable performance to an actual device. Before you publish your app to the Windows Phone Store, however, it is recommended that you test your app on a physical device.

You can test your app on a unique emulator image for each of the OS versions and screen resolutions supported by Windows Phone. The default emulator image in Visual Studio is Emulator WVGA 512MB, which emulates a memory-constrained Windows Phone 8 phone. This default selection encourages you to target the largest possible market for your Windows Phone 8 app.

To run the application in the emulator, simply click the button in the toolbar. This will do the following:

  1. Build your app.
  2. Package your app.
  3. Start the emulator (if it isn’t already running).
  4. Deploy (install) your app in the emulator.
  5. Start the app.

Of course, there’s not much to see yet, but at least your app is running!

Device

The emulator is designed to provide comparable performance to an actual device. Before you publish your app to the Windows Phone Store, however, it is recommended that you test your app on a physical device.

There are three prerequisites to running your app on a device from Visual Studio:

  1. Register with the Windows Phone Dev Center at http://bit.ly/StpJhE. When you set up your development environment this was an optional step. To run your app on a device this is required.
  2. Acquire a Windows Phone device. This might seem obvious, but you never can tell.
  3. Unlock the device using the Windows Phone Developer Registration tool that was installed on your machine when you installed Visual Studio. After you unlock your device you should see a screen like this:

 

After you have unlocked your Windows Phone running your app on the device is simple.

  1. Click the arrow on the right hand side of the button in the toolbar.
  2. Select Device from the dropdown.
  3. Click the button in the toolbar.

This will do the following:

  1. Build your app.
  2. Package your app.
  3. Deploy (install) your app to the device.
  4. Start the app on the device.

VISUAL STUDIO TIP

You don’t have to press the toolbar button to run your app. After you’ve selected where you want your app to run (Emulator or Device) you can press F6 to simply run the app or press F5 to run the app in debug mode to step through code.

 

That’s how you run your first Windows Phone app! Of course there isn’t much to see yet. In the next lesson you’ll start building out the user interface.

Previous Posts in this Series

  • Setting up the Development Environment
  • Creating Your First Windows Phone Project
  • Exploring the Windows Phone Project

Additional Resources