Floating FB popout byF5debug

101 How to on Windows Phone – How to #96 – How to Simulate Lock and Unlock Screen Scenarios in Windows Phone Emulator

 

In this article we are going to see how to Simulate the Lock screen behavior while testing the application in Windows Phone Emulator. With this feature check we can test how our apps restores its state while activating and deactivating the Lock screen when the application is in working stage. The application instead of going to terminated state it should go to dormant stage unless we have enabled tombstoning on debugging the application. While the phone is unlocked the app will basically be activated and restores the state of the application.    [more]

Let us see how we can use this feature in Windows Phone Emulator while locking and unlocking the application. Open Visual Studio 2012 IDE in administrator mode and open an existing application which we developed in our previous articles as shown in the screen below.

image

Now let us see how we can simulate the lock screen scenarios in Windows Phone Emulator, first run the application in emulator or the device without debugging mode as shown in the screen below.

image

In Visual Studio 2012 IDE, under tools menu we have an option Simulation Dashboard which will be the primary tool to test the scenarios. Click on the Simulation Dashboard will show a popup window as shown in the screen below.

image


In the simulation dashboard we can see the option Lock Screen with 2 radio buttons Locked and Unlocked. So we can change between these 2 options to test the application in the Lock Scenario and in the Unlock scenario. From the coding perspective when the phone is locked first the Obscured event happens and followed by the Deactivate event will be raised and when the phone is unlocked first the Activated event will be raised and then the UnObscured event will be raised.

About Author: Karthikeyan Anbarasan, Microsoft MVP (Most Valuable Professional) in ASP.NET/IIS Architecture. He is the Founder and Chief Editor of the www.f5debug.net website and has authored books on Windows Phone and Business Intelligence(SSIS). He is also a Passionate Speaker and a Blogger on Microsoft Technologies.

You can Join Me On: Facebook, Twitter, Google Plus, LinkedIn

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Recent Posts

Random Posts

Most Viewed

URL Shortner

Create your own short urls!!!

Site Counter

free counters

Disclaimer

This is a personal weblog. The opinions expressed here represent my own and not those of my employer. For accuracy and official reference refer to MSDN/ TechNet. I have documented my personal experience on this blog.

Protected by Copyscape Web Plagiarism Finder

Site Meter