Home arrow Smartphone Development arrow Test Your Smartphone Apps with Windows Phone Emulator

Test Your Smartphone Apps with Windows Phone Emulator

The Windows Phone Emulator is a tool that allows you to develop, debug, and test your Windows Phone applications right from your computer. It provides a virtual comparison of how your app will look and behave on an actual Windows Phone device. The emulator does offer some money-saving advantages, but it obviously should not be seen as a total replacement to testing on a physical Windows Phone device. This tutorial will provide an overview of some ways in which the Windows Phone Emulator can help you test your apps.

By: wubayou
Rating: starstarstarstarstar / 0
June 03, 2011

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

How to start, stop, and restart an application in the Windows Phone Emulator

Open Visual Studio 2010 Express for Windows Phone.  Locate the project you want to test in the emulator, and open it.  Go to the Standard toolbar's target device drop-down list.  Select the Windows Phone Emulator option.  You can start the application in the emulator by going to the Debug menu and clicking on Start Debugging.  If you prefer the shortcut method, you can simply press F5.

If you want your application to deploy faster, do not close the emulator window.  Keeping it open not only gives the advantage of faster deployment, but it also lets you maintain the application's current state and gives you access to the Start screen.

When you want to stop an application that is running in the emulator, you have three quick methods to do so that will also keep the emulator open.  The first option is to just click the Back button in the emulator itself.  You may have to click the Back button multiple times to exit the application if you are not on its primary page.  You can also select Stop Debugging, or use the shortcut method of pressing Shift and F5 at the same time.  Both of these options are to be executed in Visual Studio.  The debugging session will end and you will see the Start screen.  The emulator will remain open, however, so that you can run deploy once again but in a quicker manner.

Once you are ready to restart an application, simply click on the application list arrow on the Start screen.  Click on the application's icon, and the application should restart without debugging.

 

How to test your application's orientation in the Windows Phone Emulator

Since Windows Phones offer the capability to view items in both portrait and landscape mode, this is one feature of your application that could be considered to be very important.  You want to ensure that your application behaves appropriately no matter what the orientation.  Luckily, the Windows Phone Emulator can test this feature.  You will be able to change the orientation to the portrait up, landscape left, or landscape right states.  As you change between the states, the emulator's size will remain constant.

Changing the orientation in the Windows Phone Emulator is very easy to do.  Before you try it, however, your computer's keyboard must be disabled.  If it is not, the changes in orientation will not be supported.

To change the application's orientation, go to the emulator toolbar.  You should see two buttons that show a pair of boxes and an arrow.  These represent the rotate left and rotate right functions.  Click on either one of the buttons to change the orientation to the desired position.

 

How to use the Windows Phone Emulator to test your application's copy and paste functionality

Copy and paste is another important application feature that you may want to test via the Windows Phone Emulator.   To test this feature, your application will need a page that you can add controls to.  In the XAML file for that specific page, add the controls by inserting this code:

<TextBox Height="72" Margin="12,70,0,0" Name="textBox1" Text="Hello World" VerticalAlignment="Top" />

<TextBox Height="72" Margin="12,203,0,0" Name="textBox2" Text="" VerticalAlignment="Top" />

Once the code is inserted into the XAML file, run the application by selecting Windows Phone Emulator from the Standard toolbar in Visual Studio 2010 Express for Windows Phone.  Go to the Debug menu and select the Start Without Debugging option.  This will launch the emulator and activate the application.

With the application running, you can finally test copy and paste functionality.  Look for the Hello World text.  Click in its field.  This will bring up the on-screen keyboard.  Click on the word Hello to select/highlight it.  A small copy icon should appear.  Click and drag the drag handle until World is also selected.  With both words selected, click the small copy icon.  This will prompt a paste icon to appear above the keyboard.  Close the keyboard by clicking your cursor anywhere outside of the text box.  Click your cursor inside the second available text box to bring up the on-screen keyboard and paste icon once again.  Click on the paste icon to paste Hello World in the second text box.  This will show you how copy and paste functions within your application.

These are just a couple of examples of how you can use the Windows Phone Emulator to test your apps.  Other things you can test include location functions, accelerometer behavior, and more.  Again, the emulator is no substitute for an actual Windows Phone device, but it can come in handy in certain situations.

 

 

 

 

 

 

 

 

 


 
 
>>> More Smartphone Development Articles          >>> More By wubayou
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SMARTPHONE DEVELOPMENT ARTICLES

- Is Facebook Working on a Branded Smartphone?
- Apple iOS 6 Packed With Features
- Finally, Ubuntu OS for Smartphones?
- App Developers Offer Thoughts on Windows Pho...
- App Promo Survey Displays Developer Struggles
- Apptopia Market Helps Developers Recoup Inve...
- Is Fragmentation a Plus for App Developers?
- Juniper Networks: Android App Malware Increa...
- Developer's Losing Interest in Android?
- Android Developers Pushed Towards Google Wal...
- Google Increases Android App Size Limit
- ATandT To Charge App Developers, Android Lac...
- Android Slipping in App War versus Apple
- Apple and Google Battle to Clean Up App Mark...
- iOS Development: Hello World! in Xcode Part 2

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: