Monday, January 10, 2011

Execution Model Overview – Windows Phone 7

Windows Phone 7 execution model describes the life cycle of the applications running on Windows Phone from launching an application till its terminations. The aim of designed execution model is that it ensures a fast and responsive experience to the end users. In order to implement this model prioritize the foreground applications and terminates all background applications. Also it provides enhanced user navigation to and forth across the application screens. To implement this seamless navigation Windows phone activates and deactivates the applications dynamically.
When we talk about the Windows Phone execution model, we come across a lot of keywords such as

Tombstoning : Scenario where OS terminates an application when the user navigates away from the application. Here OS maintains the state information.
Page state: This refers to the visual state of the application page.
Application state: The state of the application that is not associated with a specific page.
Persistent data: Data that is shared by all instances of an application.
Transient state: Data that represents a single instance of an application.

Now let’s walk through on the life cycle of an application, All events related to the life cycle of a Windows Phone Application are members of the PhoneApplicationService class. We have the following events.

Launching:
An application is said to be launched when the user starts by taping the Start button and not by hitting the back button to return to a previously started application. Here a new instance of an application is started. Launching event is raised.

Running:
After the Launching event is handled, an application starts running. While an application is in this state, it manages its own state as the user navigates through the application’s pages.

Closing:
One possibility is that the user presses the hardware Back button to navigate backwards through the pages of the application, past the application’s first page. When this occurs, the Closing event is raised and the application is terminated.

Deactivating:
This state is reached when a running application is replaced in foreground by a another application, then the first application will get deactivated.

Activating:
When the user returns to a tombstoned application, it is reactivated and the Activated event is raised. In this event, an application can read values from the State dictionary in the PhoneApplicationService class to reestablish the state of the application that the user experienced before the application was deactivated.

No comments:

Post a Comment

Installing ASP.NET MVC

Installing ASP.NET MVC Before we dive deep into the ASP.NET MVC, let’s install it our development machine. This is very straight forwa...