Fast Application Switching in the "Tidy" application

Version: 1.0.0

Description

Fast Application Switching (FAS) allows applications to stay dormant (in memory) after deactivation. By detecting whether your application is being activated from a dormant state instead of a tombstoned state, you can optimize it to have quicker resume times. This lab will show you how to use the ActivatedEventArgs parameter in the application life-cycle events to the test whether or not your application instance was preserved using FAS.

Overview

The original Windows® Phone operating system had each application that was not currently active tombstoned, which essentially meant its state was serialized and kept in the application’s isolated storage. Were the user to return to the tombstoned application, he would have to wait a while as the application deserialized its state and recovered.

With Windows® Phone Codenamed Mango that is no longer the case. Once an application is sent to the background the operating system keeps its image alive in memory for as long as possible without impairing the performance of the currently active application. Should the user reactivate the application, the experience would be virtually instantaneous as restoring the application’s in-memory image is a fast operation.

This new mechanism is called Fast Application Switching (FAS) and in this lab we show how to be aware of the manner in which your application was restored after being deactivated. Knowing whether your application’s image was preserved will allow you to perform the necessary operations to recover the application’s state, and this lab will demonstrate how to perform this distinction using the Tidy application.

This lab provides instructions to help you achieve the following:

  • Recognize, once your application is activated, whether its image was preserved.
  • Force the application to perform tombstoning for debugging purposes.

The following prerequisites are required to gain the most can be gained from this hands-on lab:

  • You should install Microsoft Visual Studio 2010 or Microsoft Visual C# Express 2010, and the Windows® Phone Developer Tools available at https://go.microsoft.com/?linkid=9772716
  • You should have previous knowledge on how to create applications for the Windows® Phone 7.
  • You should be familiar with the Windows® Phone application lifecycle management system.