In one of my previous Blog post we had a look at the Windows Phone 7 App Structure. In this post I will cover how the App runs in Windows Phone 7, we will also see the different layers of the WP7 UI.
WP7 app has four stages:
- When the App is not running
- When the App starts
- When the App is Running
- When the App Exits
Phone call gets precedence over any running App. Running App is automatically paused and moved to the background. Shell UI Obscures application UI. Developer has to take care that when the interruption is over, App should be in the state it was prior to the interruption.
Events which could obscure an App could be a
Activation & Deactivation of the App
Deactivation of an App can happen by
When you press start button the currently running App gets deactivated. When App is deactivated it gets killed as it cannot run in the background, hence the App state should be saved when it is deactivated and it should load that saved state, when the app gets activated again, the developer has to ensure that the app behaves properly when it is deactivated. This ensures that the resources are utilized optimally. The user should not feel that its a whole new instance of App and the experience should be seamless.
For example: You start IE from startup screen, do some website surfing and then again press start button to go to the home screen, you then start Twitter App, you post a Tweet and reply to couple of Tweets.
At this point, in the memory stack the top most app is Twitter App which is currently running, then it is IE, these are the active sessions. Though the Apps are not running in the background their last states are saved.
Now when you press the back button the current twitter app is terminated and you go back to the home screen, press back again and you are taken to the IE screen with the website you were surfing. you press back button again and you go to the home screen again, the memory stack is now empty.
Different layers of UI
Below I have tried to breakdown the UI of WP7 to look at how it functions. It is arranged in the Z-order as they exist.
- Bottom layer – Direct 3D surface
- Startup Screen
- Running Application
- Keyboard (if user input is required in a textbox like control)
- App Bar (It is very specific to the application)
- Incoming Call (takes the precedence over any running app)
- Top layer - System Tray
Different Layers of the WP7 UI