Windows Phone 7 - Overview

Happy New Year 2011!! 
In this blog post, I will take a look at Windows Phone 7 and how to develop an application for this platform. Why should we develop for Windows Phone 7 -
  • There is a huge market for mobile apps
  • Consumers expect all of their apps (even business apps) to have mobile components
A Windows Phone 7 has 6 hubs. A hub is nothing but a kind of grouping for items that are related. The 6 hubs are -
  • People
  • Office
  • Pictures
  • Music + Video
  • Marketplace
  • Games
Framework Components
At the core of the framework is common base class library. On top of it is Application Object which provides common application features such as application management, session etc. On top of this are 2 components - Silverlight and XNA. As you know, XNA is mostly for games development and Silverlight for mostly apps development. On top of this resides a set of windows phone frameworks -
  • PhoneApplicationFrame - core of UI
  • PhoneApplicationPage - core of UI
  • PushNotification - enables your app to receive notification even if they are not running. Currently, windows phone doesn't allow multitasking but PushNotification can still work because it doesn't require the app to be running.
  • WebBrowserControl - to access web, so that users don't have to close the app to browse web
  • Sensors
  • Camera
  • DeviceIntegration
  • Launchers and Choosers - enables you to interact with some of the phone's native applications like media player.
  • Windows Phone Controls - Textbox, images, media element etc
WMAppManifest.xml file
  • This manifest defines the capabilities for an application. By using the capability detection tool, this list can be condensed to just keep the capabilities required by the app.
  • In here we also specify the default page to load in the DefaultTask element.
  • It also defines other properties such as background image and icon for the application.
  • You can not define the splash screen image in the manifest as the splash screen image loads before the manifest.
  • Some other properties that will come up in the market place (author, description, title etc) can be defined in the App element.
Application Events
  • These are defined in the App.xaml
  • Application_Launching/Closing - when the application is launched/closed.
  • Application_Deactivated - When app get tombstoned (user has moved away say by opening a browser or something else)
  • Application_Activated - When you return back to the app
  • Activated, Deactivated don't get called while Launching, Closing respectively.
Panorama Application
  • Idea behind panorama applications is that in this UI is a long horizontal space in which controls are placed. This space is bigger than the screen size and you can continously go farther and farther on the right side as you make choices.
  • The guidance suggests that you should have minimum of 3 items in the panorama control.
  • Also, the guidance suggests that you should not use an application bar with panorama control.
  • Panorama is a control which can then contain multiple PanoramaItem. Each PanoramaItem can then contain other controls that you want to show as part of the item.
  • By default, Panorama application projects implement Model-View-ViewModel pattern.
Pivot Application
  • Idea behind pivot applications is that in this UI the controls keep on rotating like in a circle. 
  • Pivot is a control which can then contain multiple PivotItem. Each PivotItem can then contain other controls.
  • Pivots can have application bars.
  • By default, pivot application project implements Model-View-ViewModel pattern.
Application States
  • Launching
  • Running
  • Closing
  • Deactivated
  • Activated
Other Notes
  • Tombstoning - Tombstoning happens when the OS terminates the app process when the user navigates away from the app. The OS maintains the state of the app and if user navigates back to the app, the OS passes the state data to the app process
  • Persistent Data - is data that is shared by all instances of an app. For ex. app settings.
  • Transient Data - is data that describes the state of a single instance of the application. Its stored in the state dictionary. State dictionary is provided by Phone Application Service.
  • Application bar is a place where we can keep common buttons for our application
  • If you change the SupportedOrientations property in MainPage.xaml or any other page to “PortraitOrLandscape”, we can tilt the phone and the page will change automatically to landscape or portrait.
  • Frame: Only a single frame is available to the application. No exceptions.
  • Besides other things Frames host pages.
  • If you want an application bar for the entire application, you should put it in the frame.
  • If you want an application bar specific to the page, you should put it in the page.
  • System Tray: is a reserved area by the system to display system level details. It can be made visible/invisible by changing the SystemTray.IsVisible property in the page xaml file.
  • Orientation: Windows phone supports both portrait and landscape orientation. You can change the orientation by changing the SupportedOrientations and Orientation property in the page xaml file. If you change the SupportedOrientations property to "PortraitOrLandscape", when you tilt the phone, the page will change accordingly.
If you download the windows phone 7 developer tools, you can start creating windows phone 7 projects. It also comes with an emulator which gives you a visual feel for your application. In the next blog post, I will create a sample windows phone 7 application.