Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microsoft Build 2016 11/9/2018 8:05 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,

Similar presentations


Presentation on theme: "Microsoft Build 2016 11/9/2018 8:05 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,"— Presentation transcript:

1 Microsoft Build 2016 11/9/2018 8:05 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2 B817 Windows Application Lifecycle From Activation and Suspension to Background Execution, Multitasking and Extended Execution Chris Cortes and Stefan Wick Program Managers

3 GREAT USER EXPERIENCE ACROSS ONE BILLION DEVICES
PC Xbox Surface Hub Mobile Devices + IoT Holographic

4 Basics of the Application Lifecycle Background Activation Multitasking
11/9/2018 8:05 PM Basics of the Application Lifecycle Background Activation Multitasking Resource Management © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

5 Basics of the Application Lifecycle
11/9/2018 8:05 PM Basics of the Application Lifecycle © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

6 Application Lifecycle
Build 2014 11/9/2018 Application Lifecycle Apps can be in 1 of 3 states Not Running Running Suspended Applications receive callbacks or events on transitions OnLaunched or OnActivated Suspending Resuming Except: Suspended->NotRunning Running Not Running Suspended © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

7 Daily App Usage Pattern
Build 2014 11/9/2018 Daily App Usage Pattern Memory Usage CPU CPU OnLaunched Suspending Resuming Suspending © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

8 Background Activation
11/9/2018 8:05 PM Background Activation © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

9 Triggers Windows 8.1 Windows 10 WP 8.1 SystemTrigger TimeTrigger
Build 2014 11/9/2018 Triggers SystemTrigger TimeTrigger MaintenanceTrigger DeviceUseTrigger DeviceServicingTrigger PushNotificationTrigger AppointmentStoreNotificationTrigger ContactStoreNotificationTrigger BluetoothLEAdvertisementWatcherTrigger BluetoothLEAdvertisementPublisherTrigger DeviceWatcherTrigger ActivitySensorTrigger SensorDataThresholdTrigger ToastNotificationHistoryChangedTrigger ToastNotificationActionTrigger ApplicationTrigger MediaProcessingTrigger SocketActivityTrigger Windows 8.1 Windows 10 CachedFileUpdaterTrigger DeviceConnectionChangeTrigger GattCharacteristicNotificationTrigger RfcommConnectionTrigger LocationTrigger WP 8.1 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

10 Trigger Implementation
11/9/2018 8:05 PM Trigger Implementation private void RegisterBackgroundTask() {   var builder = new BackgroundTaskBuilder();   builder.Name = “New Post Check";   builder.TaskEntryPoint = "BackgroundTasks.PostCheck";   var trigger = new TimeTrigger(30, false);   builder.SetTrigger(trigger);   IBackgroundTaskRegistration task = builder.Register(); } public async void Run(IBackgroundTaskInstance taskInstance) { var deferral = taskInstance.GetDeferral(); try taskInstance.Canceled += OnCanceled; var result = await DoWorkAsync(deferral); } finally {deferral.Complete();} © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

11 Task Lifetime Default Background Tasks Long-Running Background Tasks
Build 2014 11/9/2018 Task Lifetime Ideal Terminated Canceled Run() Run() Run() Cancel() Execution Time Default Background Tasks Execution time of 25 seconds Cancel time of 5 seconds Long-Running Background Tasks ApplicationTrigger, MaintenanceTrigger, DeviceUseTrigger, RfCommConnectionTrigger © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

12 Background Task Process
Build 2014 11/9/2018 Background Task Process Windows 8 Upcoming Release App Container app.exe CoreApplication BackgroundTask backgroundtaskhost.exe App Container app.exe OnLaunched() OnBackground Activated() Default Task Hosted in a separate process Implement IBackgroundTask Single Process Model Work directly in CoreApplication Less Code, Easier communication © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

13 Demo ContactStoreNotificationTrigger in the Single-Process-Model
Microsoft Build 2016 11/9/2018 8:05 PM Demo ContactStoreNotificationTrigger in the Single-Process-Model Stefan Wick © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

14 Three Steps to Background Execution
11/9/2018 8:05 PM Three Steps to Background Execution Request Background Access Background Execution Manager Inform of User Configuration Needs Battery Saver and Privacy Settings Register for Background Activity BackgroundTaskBuilder.Register() © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

15 Daily App Usage Pattern
Build 2014 11/9/2018 Daily App Usage Pattern Memory Usage CPU CPU OnLaunched Suspending Resuming Suspending © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

16 11/9/2018 8:05 PM Multitasking © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

17 Activity Sponsored Execution
11/9/2018 8:05 PM Activity Sponsored Execution Manifest Entry <Capabilities> <uap3:Capability Name="backgroundMediaPlayback" /> </Capabilities> Press Play var player = new MediaPlayer(); player.Source = MediaSource.CreateFromUri(new Uri(" player.Play(); No Registration Code, No Background Management © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

18 Running State Extension
Build 2014 11/9/2018 Running State Extension Extended Execution Session Up to 10 minutes on Battery Memory Usage CPU Activated Navigate Away Navigate To Suspended © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

19 Demo Extended Execution
Microsoft Build 2016 11/9/2018 8:05 PM Demo Extended Execution Stefan Wick © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

20 Suspending State Extension
Build 2014 11/9/2018 Suspending State Extension Extended Session Up to 10 Minutes Memory Usage CPU Activated Suspending Suspended © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

21 SavingData Extended Execution
11/9/2018 8:05 PM SavingData Extended Execution private async void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); try using (var session = new ExtendedExecutionSession()) session.Reason = ExtendedExecutionReason.SavingData; session.Description = "Upload Data"; session.Revoked += session_Revoked; var result = await session.RequestExtensionAsync(); if (result == ExtendedExecutionResult.Allowed) var completionTime = await UploadDataAsync(deferral); } else { await SaveDataLocallyAsync(deferral); } } finally { deferral.Complete(); } private async void session_Revoked(object sender, ExtendedExecutionRevokedEventArgs args) if(args.Reason == ExtendedExecutionRevokedReason.SystemPolicy) await SaveDataLocally(); © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

22 Methods for Background Execution
11/9/2018 8:05 PM Methods for Background Execution Triggers Based on conditions, in process of your choice Activity Sponsored Execution Background media activity, Reduced code Extended Execution Generic Running and Suspending extension © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

23 Resource Management 11/9/2018 8:05 PM
© 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

24 Memory Usage Memory Limit Foreground Background Foreground Background
Build 2014 11/9/2018 Memory Usage Foreground Background Foreground Background Foreground Memory Limit Memory Activated Entered Background Leaving Background Entered Background Leaving Background © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

25 Memory Manager ulong usageLimit = MemoryManager.AppMemoryUsageLimit;
ulong usage = MemoryManager.AppMemoryUsage; ulong headroom = usageLimit - usage; MemoryManager.AppMemoryUsageIncreased += OnAppMemoryUsageIncreased; MemoryManager.AppMemoryUsageDecreased += OnAppMemoryUsageDecreased; var usageLevel = MemoryManager.AppMemoryUsageLevel; if(usageLevel == AppMemoryUsageLevel.Low) ;// Doing Well. else if(usageLevel == AppMemoryUsageLevel.Medium) else if(usageLevel == AppMemoryUsageLevel.High) ;// Near limit, clear caches and scale down assets. else if(usageLevel == AppMemoryUsageLevel.OverLimit) ;// Reduce as much as possible to avoid termination. © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

26 Improvements in Upcoming Release
11/9/2018 8:05 PM Improvements in Upcoming Release Single Process Model Background Activation and Execution in App Activity Sponsored Execution Media playback activity, Reduced code Unspecified Extended Execution No time limit when connected to power or set in Battery Use Over Memory Limit Notification Memory Manager callback instead of termination © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

27 GREAT USER EXPERIENCE ACROSS ONE BILLION DEVICES
PC Xbox Surface Hub Mobile Devices +IoT Holographic

28 Other Sessions Windows Store: Publishing Apps and Games to Desktop, Mobile, and Xbox at 10:30. Enterprise Apps and the Windows Store for Business on Channel 9. App Extensibility: Build an Ecosystem of Apps on Channel 9. Continue your education at Microsoft Virtual Academy online.

29 Please Complete An Evaluation Form Your input is important!
11/9/2018 Please Complete An Evaluation Form Your input is important! or © 2016 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

30 11/9/2018 8:05 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "Microsoft Build 2016 11/9/2018 8:05 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,"

Similar presentations


Ads by Google