SlideShare una empresa de Scribd logo
1 de 47
Rudi Grobler http://www.rudigrobler.net @rudigrobler An end-to-end experience of Windows Phone 7 development TRACK: NEXT GENERATION
agenda
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
Orientation using VSM demo
orientation + SIP SIP takes up more space landscape than portrait vs
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
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
Application bar
application bar Page scoped – Search, etc Not for item specific actions like save/delete, rather use the ContextMenu Above SIP
basic application lifecycle
Low Battery a world of interruptions Phone Calls Lock Screen Text Message Reminders Application Switch
Application lifecycle – the problem
moved to background Save state Dormant Tombstoned Restore state Fast switching a.k.a. dormant
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)
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
lifecycle events - page OnNavigateTo OnNavigateFrom
Application lifecycle – the solution
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
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
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
Test your tombstoning!!!
phone threading model  Touch thread
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
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
Location + Accuracy -  Power -  Speed -  Indoors -  Accuracy + Power + Speed -  Wilderness +/- Accuracy +/- Power +/- Speed +/- Urban areas Location services WiFi Cell towers
Location
GeoCoordinateWatcher Warm it up Singleton Can be disabled
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
performance counters Application.Current.Host.Settings.EnableFrameRateCounter= true;
push notifications Server-initiated communication Enable key background scenarios Preserves battery life and user experience Prevents polling for updates
types of notifications Toast Tile Deep toast
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
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
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
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
NuGet
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
Text input
memory constraints Do not use more than 90mb of RAM Use Coding4Fun Toolkit MemoryCounter +/- 30% reduction in working set
Certification checklist No network, no problem? <90MB? Theme aware? Handles exceptions? Back button works as expected? User consent dialogs & settings
Monitor your application Add a “Send Feedback” button Store crash data and ask user to email it Analytics
@rudigrobler Slides, demos, etc… http://www.rudigrobler.net questions
Don’t forget the Xbox Kinectshow-down after sessions this evening!
DevDays 2011 Sponsors PLATINUM SPONSOR www.bbd.co.za SILVER SPONSOR www.dvt.co.za SILVER SPONSOR www.ctutraining.co.za
Keep in Touch facebook.com/msdevsa @msdevsa http://blogs.msdn.com/southafrica
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation.  Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.  MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Más contenido relacionado

La actualidad más candente

What’s New in Flash Player 11.2 and Adobe AIR 3.2
What’s New in Flash Player 11.2 and Adobe AIR 3.2What’s New in Flash Player 11.2 and Adobe AIR 3.2
What’s New in Flash Player 11.2 and Adobe AIR 3.2
Joseph Labrecque
 
Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App Development
Chris Morrell
 
Windows phone 7 overview
Windows phone 7 overviewWindows phone 7 overview
Windows phone 7 overview
Soumow Dollon
 
iTunes App Store Submission Process
iTunes App Store Submission ProcessiTunes App Store Submission Process
iTunes App Store Submission Process
Anscamobile
 
Titanium Meetup Deck
Titanium Meetup DeckTitanium Meetup Deck
Titanium Meetup Deck
sschwarzhoff
 
Adobe AIR Mobile development for Android and PlayBook
Adobe AIR Mobile development for Android and PlayBookAdobe AIR Mobile development for Android and PlayBook
Adobe AIR Mobile development for Android and PlayBook
Mihai Corlan
 

La actualidad más candente (20)

What’s New in Flash Player 11.2 and Adobe AIR 3.2
What’s New in Flash Player 11.2 and Adobe AIR 3.2What’s New in Flash Player 11.2 and Adobe AIR 3.2
What’s New in Flash Player 11.2 and Adobe AIR 3.2
 
An end-to-end experience of Windows Phone 7 development (Part 2)
An end-to-end experience of Windows Phone 7 development (Part 2)An end-to-end experience of Windows Phone 7 development (Part 2)
An end-to-end experience of Windows Phone 7 development (Part 2)
 
Xamarin Forms - Hello World with Vitamins
Xamarin Forms - Hello World with VitaminsXamarin Forms - Hello World with Vitamins
Xamarin Forms - Hello World with Vitamins
 
Lublin Startup Festival - Mobile Architecture Design Patterns
Lublin Startup Festival - Mobile Architecture Design PatternsLublin Startup Festival - Mobile Architecture Design Patterns
Lublin Startup Festival - Mobile Architecture Design Patterns
 
QBS Visual Studio 2012 and modern windows apps
QBS Visual Studio 2012 and modern windows appsQBS Visual Studio 2012 and modern windows apps
QBS Visual Studio 2012 and modern windows apps
 
Performance testing – mobile apps session1
Performance testing – mobile apps   session1Performance testing – mobile apps   session1
Performance testing – mobile apps session1
 
Appium Interview Questions and Answers | Edureka
Appium Interview Questions and Answers | EdurekaAppium Interview Questions and Answers | Edureka
Appium Interview Questions and Answers | Edureka
 
Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App Development
 
Windows phone 7 overview
Windows phone 7 overviewWindows phone 7 overview
Windows phone 7 overview
 
Mobile Test Automation
Mobile Test AutomationMobile Test Automation
Mobile Test Automation
 
Xamarin Technical Assessment Against Native for Cross Platform Mobile Develop...
Xamarin Technical Assessment Against Native for Cross Platform Mobile Develop...Xamarin Technical Assessment Against Native for Cross Platform Mobile Develop...
Xamarin Technical Assessment Against Native for Cross Platform Mobile Develop...
 
iTunes App Store Submission Process
iTunes App Store Submission ProcessiTunes App Store Submission Process
iTunes App Store Submission Process
 
Titanium Meetup Deck
Titanium Meetup DeckTitanium Meetup Deck
Titanium Meetup Deck
 
Mobile automation testing with selenium and appium
Mobile automation testing with selenium and appiumMobile automation testing with selenium and appium
Mobile automation testing with selenium and appium
 
IBM MobileFirst Platform v7.0 pot intro v0.1
IBM MobileFirst Platform v7.0 pot intro v0.1IBM MobileFirst Platform v7.0 pot intro v0.1
IBM MobileFirst Platform v7.0 pot intro v0.1
 
Adobe AIR Mobile development for Android and PlayBook
Adobe AIR Mobile development for Android and PlayBookAdobe AIR Mobile development for Android and PlayBook
Adobe AIR Mobile development for Android and PlayBook
 
Advanced Appium Tips & Tricks with Jonathan Lipps
Advanced Appium Tips & Tricks with Jonathan LippsAdvanced Appium Tips & Tricks with Jonathan Lipps
Advanced Appium Tips & Tricks with Jonathan Lipps
 
Xamarin.Forms Hands On Lab (Intermediate)
Xamarin.Forms Hands On Lab (Intermediate)Xamarin.Forms Hands On Lab (Intermediate)
Xamarin.Forms Hands On Lab (Intermediate)
 
Appium meet up noida
Appium meet up noidaAppium meet up noida
Appium meet up noida
 
Xamarin.Forms Hands On Lab (Advanced)
Xamarin.Forms Hands On Lab (Advanced)Xamarin.Forms Hands On Lab (Advanced)
Xamarin.Forms Hands On Lab (Advanced)
 

Destacado (8)

ありがとうすまこん@横浜3年間ちょっとの奇跡
ありがとうすまこん@横浜3年間ちょっとの奇跡ありがとうすまこん@横浜3年間ちょっとの奇跡
ありがとうすまこん@横浜3年間ちょっとの奇跡
 
Magic solution mind map
Magic solution mind mapMagic solution mind map
Magic solution mind map
 
ITツールのイベント活用術
ITツールのイベント活用術ITツールのイベント活用術
ITツールのイベント活用術
 
スマートフォンは日用品なんかじゃないぞ!
スマートフォンは日用品なんかじゃないぞ!スマートフォンは日用品なんかじゃないぞ!
スマートフォンは日用品なんかじゃないぞ!
 
スマートフォンで使うWebアプリ
スマートフォンで使うWebアプリスマートフォンで使うWebアプリ
スマートフォンで使うWebアプリ
 
わたしがAndroidに変えたわけ
わたしがAndroidに変えたわけわたしがAndroidに変えたわけ
わたしがAndroidに変えたわけ
 
スマートフォン懇親会special
スマートフォン懇親会specialスマートフォン懇親会special
スマートフォン懇親会special
 
Androidの会のご紹介
Androidの会のご紹介Androidの会のご紹介
Androidの会のご紹介
 

Similar a An end-to-end experience of Windows Phone 7 development (Part 1)

Build Cross-Platform Mobile Application with PhoneGap
Build Cross-Platform Mobile Application with PhoneGapBuild Cross-Platform Mobile Application with PhoneGap
Build Cross-Platform Mobile Application with PhoneGap
Allan Huang
 
Windows Phone 7 and Silverlight
Windows Phone 7 and SilverlightWindows Phone 7 and Silverlight
Windows Phone 7 and Silverlight
Glen Gordon
 
Windows Phone 7 Applications with Silverlight
Windows Phone 7 Applications with SilverlightWindows Phone 7 Applications with Silverlight
Windows Phone 7 Applications with Silverlight
Rishu Mehra
 
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightRe-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Frank La Vigne
 
Windows Phone 8.1 アプリ開発徹底解説
Windows Phone 8.1 アプリ開発徹底解説Windows Phone 8.1 アプリ開発徹底解説
Windows Phone 8.1 アプリ開発徹底解説
shinobu takahashi
 

Similar a An end-to-end experience of Windows Phone 7 development (Part 1) (20)

Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application Testing
 
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
 
Windows Phone 7.5 Mango - What's New
Windows Phone 7.5 Mango - What's NewWindows Phone 7.5 Mango - What's New
Windows Phone 7.5 Mango - What's New
 
Windows Phone 7 Unleashed Session 1
Windows Phone 7 Unleashed Session 1Windows Phone 7 Unleashed Session 1
Windows Phone 7 Unleashed Session 1
 
Build Cross-Platform Mobile Application with PhoneGap
Build Cross-Platform Mobile Application with PhoneGapBuild Cross-Platform Mobile Application with PhoneGap
Build Cross-Platform Mobile Application with PhoneGap
 
Develop an app for Windows 8 using HTML5
Develop an app for Windows 8 using HTML5Develop an app for Windows 8 using HTML5
Develop an app for Windows 8 using HTML5
 
Windows 8 BootCamp
Windows 8 BootCampWindows 8 BootCamp
Windows 8 BootCamp
 
Windows Phone 7 and Silverlight
Windows Phone 7 and SilverlightWindows Phone 7 and Silverlight
Windows Phone 7 and Silverlight
 
Getting started with android programming
Getting started with android programmingGetting started with android programming
Getting started with android programming
 
Android - Open Source Bridge 2011
Android - Open Source Bridge 2011Android - Open Source Bridge 2011
Android - Open Source Bridge 2011
 
Phone gap development, testing, and debugging
Phone gap development, testing, and debuggingPhone gap development, testing, and debugging
Phone gap development, testing, and debugging
 
Windows Phone 7 Applications with Silverlight
Windows Phone 7 Applications with SilverlightWindows Phone 7 Applications with Silverlight
Windows Phone 7 Applications with Silverlight
 
iPhone Programming
iPhone ProgrammingiPhone Programming
iPhone Programming
 
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightRe-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
 
Android 3.1 - Portland Code Camp 2011
Android 3.1 - Portland Code Camp 2011Android 3.1 - Portland Code Camp 2011
Android 3.1 - Portland Code Camp 2011
 
Rhodes vs Phonegap
Rhodes vs PhonegapRhodes vs Phonegap
Rhodes vs Phonegap
 
Android 3.0 Portland Java User Group 2011-03-15
Android 3.0 Portland Java User Group 2011-03-15Android 3.0 Portland Java User Group 2011-03-15
Android 3.0 Portland Java User Group 2011-03-15
 
Developing Application in WP7
Developing Application in WP7Developing Application in WP7
Developing Application in WP7
 
Windows Phone 8.1 アプリ開発徹底解説
Windows Phone 8.1 アプリ開発徹底解説Windows Phone 8.1 アプリ開発徹底解説
Windows Phone 8.1 アプリ開発徹底解説
 
Building Cross-Platform Mobile Apps
Building Cross-Platform Mobile AppsBuilding Cross-Platform Mobile Apps
Building Cross-Platform Mobile Apps
 

Último

Último (20)

Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

An end-to-end experience of Windows Phone 7 development (Part 1)

  • 1.
  • 2. Rudi Grobler http://www.rudigrobler.net @rudigrobler An end-to-end experience of Windows Phone 7 development TRACK: NEXT GENERATION
  • 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
  • 6. orientation + SIP SIP takes up more space landscape than portrait vs
  • 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
  • 10. application bar Page scoped – Search, etc Not for item specific actions like save/delete, rather use the ContextMenu Above SIP
  • 12. Low Battery a world of interruptions Phone Calls Lock Screen Text Message Reminders Application Switch
  • 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
  • 17. lifecycle events - page OnNavigateTo OnNavigateFrom
  • 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
  • 23. phone threading model Touch thread
  • 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
  • 28. GeoCoordinateWatcher Warm it up Singleton Can be disabled
  • 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
  • 32. types of notifications Toast Tile Deep toast
  • 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
  • 37. NuGet
  • 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
  • 43. @rudigrobler Slides, demos, etc… http://www.rudigrobler.net questions
  • 44. Don’t forget the Xbox Kinectshow-down after sessions this evening!
  • 45. DevDays 2011 Sponsors PLATINUM SPONSOR www.bbd.co.za SILVER SPONSOR www.dvt.co.za SILVER SPONSOR www.ctutraining.co.za
  • 46. Keep in Touch facebook.com/msdevsa @msdevsa http://blogs.msdn.com/southafrica
  • 47. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.