yochay kiriaty microsoft
DESCRIPTION
Windows Phone Platform Integration. Yochay Kiriaty Microsoft. @ yochayk. http://windowsteamblog.com /. [email protected]. http://learningwindowsphone . com. Agenda. Love and hate tombstoning What is tombstone and why you should care? The basic Advance - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/1.jpg)
ONLINE CONFERENCE
DESIGN.BUILD.DELIVERwith WINDOWS PHONE
THURSDAY 24 MARCH 2011
![Page 2: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/2.jpg)
Yochay KiriatyMicrosoft
@yochayk
http://windowsteamblog.com/
Windows Phone Platform Integration
![Page 3: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/3.jpg)
http://learningwindowsphone.com
![Page 4: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/4.jpg)
Agenda• Love and hate tombstoning
• What is tombstone and why you should care?
• The basic• Advance
• Choosers and Launchers and Tombstone• What, why, and how• Tombstoning
![Page 5: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/5.jpg)
Not running
Launching
Running
Closing
Basic Application Lifecycle
![Page 6: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/6.jpg)
Tombstone Application lifecycle
Running
Deactivated
Tombstoned (in most cases)
Activated
The application’s process is killed (in most cases)*
Save state for later use
Load state to continue where she left off
User is back where he` left off
Press Start Open toast Lock screen
![Page 7: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/7.jpg)
7
• The Windows Phone execution model is designed to provide end users with a fast, responsive experience – Only one 3rd-party application can run in the foreground – System terminates your application when user navigates away
• App is Tombstoned when user “navigates” away– System saves some state information then terminates the app– When user navigates back to the application, system restarts
it and passes state information back to the client• Developer must write code to respond to lifecycle
events– Save and restore state – Maintain illusion that the application is
running continuously
App Management
![Page 8: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/8.jpg)
8
• Application_Launching– When the application is launching– Not fired when the application is reactivated
• Application_Activated– When the application is activated– Not fired when the application is first launched
• Application_Deactivated– When the application is deactivated– Not fired when the application is closing
• Application_Closing– When the application is closing– Not fired when the application is
deactivated
Lifecycle Events
![Page 9: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/9.jpg)
9
Application Lifecycle 1
Start
Launching event
App Running
User ‘Backs’ past
first pageClosing event
User invokes chooser or
launcher, or presses Start to launch another
app
Deactivated event
![Page 10: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/10.jpg)
Application Lifecycle 2
10
Restored app instance
App Running
User presses Start and launches your
application
User completes chooser or
launcher. Or user navigates back
from other app to reach your app
Deactivated event
Activated event
New app instance
Launching event
App Running
![Page 11: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/11.jpg)
Application Lifecycle
Demo
![Page 12: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/12.jpg)
Tombstone and Controls
• Pivot– Use SelectedIndex– Must used in the page (control) loaded event
• Pano– DefaultItem– But….
• Scrollbar– VerticalOffset
• Map Control– Zoom levels and other transforms
• Picture viewer or any other control– manipulation.
![Page 13: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/13.jpg)
Tombstone & Controls
Demo
![Page 14: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/14.jpg)
Tombstone and Resources
• Camera, Video, Mic– Release on Page OnNavigatingFrom (or
earlier)• Location
– Deactivated (ideal on OnNavigatingFrom)– Remember warm-up time
• Sensors– Stop on Page OnNavigatingFrom
![Page 15: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/15.jpg)
Advance Topics
• Application’s load time– Lunching , Existing, Deceived, Activated: all
in just 10 sec– Defer loading and use background thread
• Serlilization frameworks and times– Make sure you read this
• Optimize save state – Per page– Global (MVVM)
![Page 16: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/16.jpg)
Launchers and Chooser
• Common tasks used by users– Camera, SMS, Contacts, Marketplace, etc…
• Tombstone the application– Some have relaxed tombstoning policy
• PhotoChooserTask• CameraCaptureTask• MediaPlayerLauncher• EmailAddressChooserTask• PhoneNumberChooserTask• Game Invite – Used in XNA Games• Gamer Card – Used in XNA Games
![Page 17: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/17.jpg)
Launchers, Choosers And Tombstone
Demo
![Page 18: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/18.jpg)
Summary
• Tombstone is part of your Windows Phone application – deal with it!
• Understand method call order– Do not rely on classes or page constructors– Check global objects before using– Defer work as much as possible
• Be smart when saving your state• Be aware of startup and shutdown times• Delight your users by working smart with
controls, UI, and resources
![Page 19: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/19.jpg)
Thank You for attending today’s Tech.Days Online Conference.
Today’s Online Conference will be recorded. It will be made available on-demand very soon.
Your Feedback Matters! Please complete the online evaluation form which will be emailed to you.
Feedback
![Page 20: Yochay Kiriaty Microsoft](https://reader035.vdocuments.us/reader035/viewer/2022062813/56816679550346895dda19c4/html5/thumbnails/20.jpg)
© 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.
ONLINE CONFERENCE