SlideShare une entreprise Scribd logo
1  sur  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.

Contenu connexe

Tendances

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
 

Tendances (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)
 

En vedette (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の会のご紹介
 

Similaire à 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
 

Similaire à 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
 

Dernier

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Dernier (20)

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...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

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.