4. orientation support PhoneApplicationPage.SupportedOrientations property states what orientations the page supports Portrait Landscape PortraitOrLandscape If set to PortraitOrLandscape, page will re-orientate itself automatically when the user rotates the phone You cannot force a page to re-orientate in code You can force a page to always use a specific orientation by setting the SupportedOrientations property to the value you required
7. system tray and application bar System Tray System owned indicator area that display system-level status information Apps can show/hide Application Bar Area where applications can display buttons for the most common tasks Can display pop-up menu for less common tasks
8. application bar Use the ApplicationBar instead of creating your own menu system Up to 4 buttons plus optional menu Swipe up the bar to bring up the menu All buttons must specify Text property as well as IconUrl (Changed in Beta) Don’t fill all 4 slots if not needed Use white foreground on transparent background for icons System will colorize button according to users selected theme
14. moved to background Save state Dormant Tombstoned Restore state Fast switching a.k.a. dormant
15. application management Windows Phone execution model is designed to provide end users with a fast, responsive experience Only one application can run at a time System terminates application when user navigates away Application is Tombstoned when user navigates away System saves state information then terminates you application When user navigates back to the application system restarts the application and passes state information back Developer must write code to respond to lifecycle events Save and restore state Maintain illusion that the application is running continuously Check if tombstoned (IsAppInstancePreserved)
16. lifecycle events - application Application_Launching When the application is launching (from start) Not fired when the application is reactivated Application_Activated When application is activated (brought to foreground) Not fired when the application is first launched Application_Deactivated When the application is deactivated (sent to background) Not fired when the application is closing Application_Closing When the application is closing (user hit back) Not fired when the application is deactivated
19. optimizing tombstoning (1) Know whatto save Pivot.SelectedItem TIP: Set in Loaded and NOT NavigateTo Panorama.DefaultItem ScrollViewer position (use ScrollPositionHelper) TextBox.Text ViewModel Whereto save PhoneApplicationService.Current.State[] PhoneApplicationPage.State[] Cache to IsolatedStorage Whento save Application life cycle events Page-level OnNavigateFrom/OnNavigateTo Do not save state on back navigation
20. optimizing tombstoning (2) Optimize your storage formats DataContractSerializer JSON.NET (MS implementation is VERY slow) XML Binary (More work but VERY fast) MUST rehydrate in less than 10 seconds Defer loading when possible
21. optimizing tombstoning (3) Release resources Camera, Video, Location, Sensor, etc On rehydrate/activate, remember GPS warm-up time Framework will stop audio, sensors, networking, sockets, MediaElement & camera
24. PerformanceProgressBar “The ProgressBar template for Silverlight that is built into the Windows Phone today has a negative performance cost in ‘indeterminate’ mode (the animating dots that often indicate loading during an operation of unknown time). The control is also known as ‘progress indicator’ according to the UX guidelines for the phone.” Use PerformanceProgressBar (Available in the Silverlight Toolkit for Windows Phone) Read more on Jeff Wilcox’s blog: http://bit.ly/PerformanceProgressBar ProgressIndicator
25. LowProfileImageLoader “LowProfileImageLoaderis meant to address a very specific scenario: loading lots of images from the web at the same time.” Read more on David Anson’s blog: http://bit.ly/LowProfileImageLoader Image decoding on background thread
26. Location + Accuracy - Power - Speed - Indoors - Accuracy + Power + Speed - Wilderness +/- Accuracy +/- Power +/- Speed +/- Urban areas Location services WiFi Cell towers
29. persistence All IO is restricted to Isolated Storage Create files Manage Settings Ideal for caching data Check out WP7Contrib and AgFx Isolated Storage based Relational DBs Sterling SQLite Structured storage
31. push notifications Server-initiated communication Enable key background scenarios Preserves battery life and user experience Prevents polling for updates
33. Push Notification Architecture Cloud Service Windows Phone 7 Push URI to Cloud Service 4 Push enabled application Push URI request/response 1 3 HTTP Post to URI with payload 5 Push notification to device Push client service 6 2 Push client/server negotiation MPNS
34. Scenarios/Popular Applications Weather Apps Chess by Post Send to WP7 Weather Tile Warning Toast Turn Tile Move Toast Link Tile Link Toast Beezz Seattle Traffic Map AlphaJax There are hundreds and hundreds of Push apps in Marketplace! Unread Tile Direct Toast Traffic Tile Turn Tile Move Toast
35. Windows Push Notification Server Side Helper Library “The library provides an easy way for sending all three kinds of push notification messages currently supported by Microsoft Push Notification Services (MPNS): Tile, Toast, and Raw. Our main goal here is to extract any complexity for sending push notification (PN) messages from your website (or web service) to a Windows Phone. This library helps developers to send push messages using only a few lines of code.” Read more on the Windows Phone Developer blog: http://bit.ly/PushNotificationHelper
36. don’t re-invent the wheel Control Toolkits PhoneyTools Coding4Fun Toolkit Silverlight Toolkit for Windows Phone WP7Contrib MVVM Toolkits MVVM Light Caliburn.Micro Databases Sterling SQLite AgFx
38. text input TextBoxintegrates with the software keyboard Software keyboard supports input scoping Key InputScopes: EmailNameOrAddress Text Url Number Time TelephoneNumber PasswordBox has a 1 second delay Text Text Revolution: A Game that Improves Text Entry on Mobile Touchscreen Keyboards
40. memory constraints Do not use more than 90mb of RAM Use Coding4Fun Toolkit MemoryCounter +/- 30% reduction in working set
41. Certification checklist No network, no problem? <90MB? Theme aware? Handles exceptions? Back button works as expected? User consent dialogs & settings
42. Monitor your application Add a “Send Feedback” button Store crash data and ask user to email it Analytics