Feb 24, 2016
Windows Phone 8Application FoundationThomas FennelSenior Program Manager Lead2-204
App LifecyclePerformanceMultitaskingPhone IntegrationEnterprise
Agenda slide
Click icon to add picture
Application Lifecycle
Application Lifecycle – Launching & Closing
not running closingrunningLaunching
Running in Background
launching
Launching
Closing
Application Lifecycle – Activated & Deactivated
running
deactivated
suspended
activated
tombstoned
Activate
d
Deactivated
Application Lifecycle EventsPhoneApplicationService
LaunchingActivatedDeactivatedClosing
Application Lifecycle Demo
Performance
Application PerformanceStartup is the chance to lose usersWe invested heavily in startup time for Windows Phone 8Facebook app reduced from 12 seconds to 4 seconds
Why?Execution environment improvementsCompile in the cloud Core CLR improvements
No work from developers – free (as in beer)!
Compile in the cloudMoving to CoreCLR brings Native Image Generator (NGEN)Code generation is expensive and time consuming on deviceCompile in the cloud NGEN’s your code when you submitSubmit your XAP to marketplace just as you always haveCode in XAP is NGEN’d and the XAP updated with compiled code
What about my existing app?7.1/7.8 apps are NGEN’d so Windows Phone 8 gets compiled versionOriginal 7.1 apps is kept for download to 7.1 devices
Performance is as much an art as it is a science
Users care about perceived performance not benchmarksKey Performance IndicatorsHow often you use the app really impacts your feel for performance• 4 seconds is still too long for the app you use all the time
Perception is impacted by context switching• Even if your app starts super fast if the user has to remember where they were it slows
them down
Resuming applicationsIn 7.5 we allowed apps to be in a suspended stateThis is great but…Only get the benefit if you tap back or use the task switcher we resumed the apps
Task switcher isn’t a feature that every user will use
Multitasking
Multitasking on Windows Phone
Windows Phone 7Tombstoning
Run Under Lock
Notifications
Windows Phone 7.5Fast App Switching
Background Audio Playback
Generic Background Agents
Windows Phone 8VoIP
Continuous Background Execution
Fast App Resume
Evolution of Multitasking
What is Fast App Resume?
Fast App Resume UX
Resume previous experience for Primary tilewhen previously launched via Primary tile
Start fresh for Deep Linkswhen previously launched via Primary tile or a different Deep Link
Don’t block OnBackKeyPressthis is how users close your app
Fast App Resume Basics
“Replace” is the default activation policyOpt-in to “Resume" via manifest setting<DefaultTask Name="_default" NavigationPage="MainPage.xaml" ActivationPolicy="Resume" />
Apps are still suspended or tombstoned
Fast App Resume In The Real World
Backstack – Do nothing
Backstack – Clear page stack
Reset: Clear the page stack
Backstack – Clear page stack
Backstack - Cancel navigation
Reset: Cancel navigation
Backstack - Cancel navigation
Fast App Resume Code Demo
Fast Resume TakeawayMain Tile: Resume!Deep Links: Clear the back stackOnBackKeyPress: Do not block Test relaunch: between primary tile and deep linksDon’t forget Tombstoning!
Integrating with Windows Phone
App Launching with URI and File AssociationURI AssociationFirst introduced @ PDC 1996 (the PDC with Steve Jobs!)Ability to register a custom URIs for your app• skype:Call?UserID=thomasfennel – starts a conversation with me in Skype• fb:Profile?UserName=thomasfennel – brings up my profile in FacebookAllows for browser integrationAllows for rich integration between apps
File AssociationRegister your own file type
Go to Sean McKenna’s Session (2-212) Friday @ 2PM
Uri Associations…
fandango:ShowTheater?ID=RegalIssaquah9
Tile Templates and Tile SizesWindows Phone 8 supports three Tile templatesFlip – flips from front to back (similar to the WP 7.1 Tile template)
Iconic – clean iconic layout designed to reflect Windows Phone design principles
Cycle – cycles through up to nine images 30
Your app can show detailed status on the lock screenYour app can show quick status (icon and count)Your app can update the background image
Lock Screen on Windows Phone 8
Lock: dynamic wallpapers – how it worksActivate via Lock+Wallpaper CPL or within app Update the wallpaper When the app is running
Using a background agent
New WinRT APIs
Go to my session (2-206) Thursday @ 11.30AM
Enterprise
EnterpriseDevice managementEnroll device with management server (inTune etc)Set policies to be applied and updatedAutomatically keep apps updated
App deploymentNo need to deploy apps into Windows Phone StoreDeploy using the technology that makes sense for your companyApps signed by you are deployable via web, email or app
Why Enterprise deployment matters to youFlexible deployment allows for considerable benefits Testing appsUses company hub to distribute latest builds of your app to you testersBeta apps in the marketplace work great but not suited to daily buildsEmail & SD card deployment allow for simplicity
With great power comes great responsibility…
SummarySignificant application runtime improvementsFast App Resume helps every app – go do it!Multitasking improvements enable key new app experiencesLive Tiles provide significant user experience advancesLockscreen and notifications allows you to build deeper integrationEnterprise deployment allows for considerable flexibility
Wednesday Thursday Friday09:00 Keynote Keynote PH 2-222
WP NetworkingPeter TorrNorth 13409:30
10:00
10:30 PH 2-211Using Native in your appsTim LavertySouth 102
PH 2-216WP Dev Best PracticesStefan WickNorth 134
11:00
11:30 PH 2-201Intro to WP DevSam GeorgeNorth 134
PH 2-202WP Design for DevCorrina BlackNorth 135
PH 2-206WP Tiles, Lock, NotificationsThomas FennelNorth 13412:00 PH 2-205
WP: MVVM in PracticeMatthias ShapiroNorth 13412:30
13:0013:3014:00 PH 2-204
WP App FoundationThomas FennelNorth 134
PH 2-215Build for Both Win 8 and WP8Matt HidingerNorth 134
PH 2-212WP Cross App CommsSean McKennaSouth 222
PH 2-220WP Map AppsMike O’MalleyNorth 13414:30
15:0015:30 PH 2-210
WP Camera appBerthier LemieuxNorth 134
PH 2-213Maximize RevenueBernardo ZamoraNorth 135
PH 2-219Story of Nokia Music from WP to Win 8Matthew CooperNorth 13416:00
16:3017:00 PH 2-207
WP Game BasicsJoao RazaSouth 304
PH 2-208WP UI in XAMLShawn OsterNorth 134
PH 2-208WP MiddlewareJC CimetiereNorth 132
PH 2-221WP Low MemoryAndrew WhitechapelNorth 135
PH 2-218WP Contest PanelPanelNorth 12317:30
Developer resourcesMSDN DOCS
Design http://aka.ms/wp8devdesignDevelo
phttp://aka.ms/wp8devdoc
Test http://aka.ms/wp8testingPublish http://aka.ms/wp8publishi
ngSamples
http://aka.ms/wp8samples
TRAINING CONTENT
Absolute Beginners http://wpdev.ms/beginvidsJump Start http://aka.ms/wp8js
Design Boot Camp http://aka.ms/wp8designbootcamp
Training Kit http://aka.ms/wp8hol
NEWS & UPDATES
Portal http://dev.windowsphone.comBlog http://wpdev.ms/developerblogChannel
9http://wpdev.ms/insidewp
Twitter http:/twitter.com/wpdev
Evaluate this sessionScan this QR code to evaluate this session and be automatically entered in a drawing to win a prize!
© 2013 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.