330 likes | 504 Views
Windows Phone 8 Application Model. Andrew Clinick Group Program Manager Windows Phone. Agenda. Running your app Multitasking Phone Integration Enterprise. Execution Model. Don’t break it. Application Performance. Startup is *the* chance to lose users
E N D
Windows Phone 8 Application Model Andrew Clinick Group Program Manager Windows Phone
Agenda • Running your app • Multitasking • Phone Integration • Enterprise
Execution Model Don’t break it
Application Performance • Startup is *the* chance to lose users • Invested heavily in startup time for Windows Phone 8 • Facebook app reduced from 12 seconds to 4 seconds • Why? • Execution environment improvements • Compile in the cloud • Core CLR improvements • Dual core >1ghz is a wonderful thing
Introducing: Compile in the cloud • Moving to CoreCLR brings Native Image Generator (NGEN) • Expensive and time consuming on device • Compile in the cloud NGEN’s your code when you submit • Submit your XAP to marketplace just as you did in 7.x • Code in XAP is NGEN’d and the XAP updated with compiled code • What about my existing app? • 7.5 apps are NGEN’d so Windows Phone 8 gets compiled version • Original 7.5 apps is kept for download to 7.5 devices
Performance is much an art as it is science • Users care about perceived performance not benchmarks • Key Performance Indicators • How 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 applications • In 7.5 we allowed apps to be in a suspended state • This 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
Introducing: Fast App Resume • Allows your app to always resume no matter where it’s launched from: • App list • Live Tile • Toast • Deep link • If your app is in the back stack then we will resume it • If it’s not then we will launch a new instance
Enabling FAR in your app • Not enabled by default. Why? • Protect your user experience • Ensure that apps don’t break • Very simple to enable • New ActivationPolicy attribute on DefaultTask • <DefaultTaskName="_default"NavigationPage="MainPage.xaml" ActivationPolicy="Resume"/> • Go to Session 2-017 (Thursday 8:30 am!) for more details on this
Background Location tracking apps • Location tracking apps are pretty limited if they can’t keep running • Enables your app to continue running in the background *if* it is actively tracking location
How to enable • <DefaultTaskName="_default"NavigationPage="Views/Home.xaml"> • <BackgroundExecution> • <ExecutionTypeName="LocationTracking" /> • </BackgroundExecution> • </DefaultTask> • Go to Session 2-017 (Thursday 8:30 am!) for more details on this
Demo • Background location
Bing Maps control from Windows Phone OS 7.1 is still supported, but deprecated The new Maps controls use technology supplied by Nokia New features: Vector-based for faster rendering Four cartographic map modes Light and dark color modes Display landmark and pedestrian features Maps
VOIP • Provide platform for *all* VOIP providers • Integrate with phone incoming call notification • Enable Video calls • Enable background audio calls • Enhanced push notification support
Demo • Skype
App Deep Linking and Sharing • Custom Schemes • First introduced @ PDC 1996 (the PDC with Steve Jobs!) • Ability to register a custom URIs for your app • skype:andrewclinick – starts a conversation with me • fb://profile/706864318 – brings up my profile • Allows for browser integration • Allows for rich integration between apps • File Types • Register your own file type • Goto 3-044 (Friday 12:45) for deep dive on this
Make a Skype call Loved the Purple Onion Peter Bergman Skype:PeterBergman
Data Storage • Structured Data • SQL Server and L2S still supported • Lots of feedback that you were looking for alternatives • Worked closely with SQLite • SQLite is available TODAY for Windows Phone • SD Card • Read Write to the SD card
Device Data • Apps can create contacts visible in the People hub • Read/write access to app’s own contacts • Read-only access to other contacts if allowed by owning app (same as Mango) create_task(ContactStore::CreateOrOpenAsync()) .then([] (ContactStore^ store) -> IAsyncAction^ { StoredContact^ george = refnewStoredContact(store); george->Description = "George Mallaley"; george->GivenName = "George"; george->FamilyName = "Mallaley"; auto props = create_task(george->GetPropertiesAsync()).get(); props->Insert(KnownContactProperties::Email, "gm@contoso.com"); returngeorge->SaveAsync(); });
Tile Templates and Tile Sizes • Windows Phone 8 supports three Tile templates • Flip – 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 25
Lock Screen on Windows Phone 8 • You can register your app as a lock screen provider, which enables: • User can select your app to show detailed status on the lock screen • Can select your app as one of the five apps to show quick status (icon and count) • Can select your app as the lock screen background image provider
Lock: dynamic wallpapers – how it works • Activate via Lock+Wallpaper CPL or within app • Update the wallpaper • When the app is running • Using a background agent • New Shell APIs • ShellSetWallpaper to use a new image • ShellWallpaperSchedule to download a single image from the internet on a specific interval (e.g., 30 mins, 1 hour, etc.) • ShellWallpaperFolderSchedule to cycle through a set of image in app’s isolated storage (e.g., a photo slideshow) based on number of views of the lock screen
Demo • Facebook
Enterprise • Device management • Enroll device with management server (inTuneetc) • Set policies to be applied and updated • Automatically keep apps updated • App deployment • No need to deploy apps into Windows Phone Store • Deploy using the technology that makes sense for your company • Apps signed by you are deployable via web, email or app • Go to 2-014 (Friday @ 2:30) for more Enterprise info
Demo • Company Hub
Why Enterprise deployment matters to you • Flexible deployment allows for considerable benefits • Testing apps • Uses company hub to distribute latest builds of your app to you testers • Beta apps in the marketplace work great but not suited to daily builds • Email & SD card deployment allow for “sneakernet” simplicity
Summary • Significant application runtime improvements • Fast App Resume helps every app • Multitasking improvements enable key new app experiences • Live Tiles provide significant user experience advances • Lockscreen and notifications allows you to build deeper integration • Enterprise deployment allows for considerable flexibility