Presentation is loading. Please wait.

Presentation is loading. Please wait.

12/5/2018 4:31 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.

Similar presentations


Presentation on theme: "12/5/2018 4:31 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN."— Presentation transcript:

1 12/5/2018 4:31 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2 What’s new for multi-tasking in UWP?
12/5/2018 4:31 AM P4172 What’s new for multi-tasking in UWP? Chris Cortes Program Manager © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

3 Multitasking and Background Activity
12/5/2018 4:31 AM Multitasking and Background Activity Background Task and Application Lifecycles New Multitasking Scenarios User Controls and Best Practices © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

4 Process Lifecycle 12/5/2018 4:31 AM
© Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

5 Background Task Lifetime
12/5/2018 4:31 AM Background Task Lifetime Ideal Terminated Canceled Run() Run() Run() Cancel() Execution Time Default Background Tasks 25s Running time 5s Canceled time Separate Component Separate Project IBackgroundTask © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

6 Application Lifecycle
12/5/2018 4:31 AM Application Lifecycle In-Process Introduced in the Anniversary Update App states Not Running Running Suspended App Callbacks Launched/On Activated Suspending/Resuming EnteredBackground/LeavingBackground © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

7 Background Scenarios 12/5/2018 4:31 AM
© Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

8 Triggers Sensors Bluetooth Toasts Network System Trigger Local Data
12/5/2018 4:31 AM Triggers GattCharacteristicNotificationTrigger GattServiceProviderTrigger BluetoothLEAdvertisementWatcherTrigger BluetoothLEAdvertisementPublisherTrigger RfCommConnectionChangeTrigger DeviceUseTrigger DeviceConnectionTrigger DeviceServicingTrigger DeviceWatcherTrigger Sensors Bluetooth ToastNotificationActionTrigger ToastNotificationActionHistoryChangedTrigger UserNotificationChangedTrigger PushNotificationTrigger SocketActivityTrigger TimeTrigger MaintenanceTrigger Toasts Network UserAway UserPresent TimeZoneChange ServicingComplete PowerStateChange NetworkStateChange InternetAvailable AppointmentStoreNotificationTrigger ContactStoreNotificationTrigger StoreNotificationTrigger CachedFileUpdaterTrigger Local Data System Trigger © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

9 12/5/2018 4:31 AM Trigger Demo © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

10 Trigger Demo Recap Background Task Code in the Main App Project
12/5/2018 4:31 AM Trigger Demo Recap Background Task Code in the Main App Project Background Activated No Manifest Entry Required Registration Groups in Creators Update © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

11 Background Task Registration Group
12/5/2018 4:31 AM Background Task Registration Group const string MyTaskGroupId = "4F8904E0-3F25-9A0C-41D3-0305E82C3333"; const string MyTaskGroupDebugName = "My Task Group"; var group = BackgroundTaskRegistration.GetTaskGroup(MyTaskGroupId); if (group == null) { group = new BackgroundTaskRegistrationGroup(MyTaskGroupId, MyTaskGroupDebugName); } var builder = new BackgroundTaskBuilder(); builder.Name = "Tasks Name"; builder.IsNetworkRequested = true; builder.TaskEntryPoint = "Tasks.MyTask"; builder.SetTrigger(myTrigger)); builder.TaskGroup = group builder.Register(); © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

12 Activity Sponsored Execution
12/5/2018 4:31 AM 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 © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

13 Extended Execution Run While Minimized Run Longer while Suspending
12/5/2018 4:31 AM Extended Execution Run While Minimized Location Tracking or Unspecified Run without a time limit Run Longer while Suspending Saving Data Revoked on a new activation Ensure good Resource Usage Time Limited on Battery Accepted into Windows Store © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

14 Enterprise Restricted Capability Device Management Policy
12/5/2018 4:31 AM Enterprise Restricted Capability <Capabilities> <rescap:Capability Name="extendedBackgroundTaskTime"/> </Capabilities> Device Management Policy ./Vendor/MSFT/Policy/Config/Privacy/LetAppsRunInBackground ./Vendor/MSFT/Policy/Config/Privacy/LetAppsRunInBackground_ForceAllowTheseApps ./Vendor/MSFT/Policy/Config/Privacy/LetAppsRunInBackground_ForceDenyTheseApps ./Vendor/MSFT/Policy/Config/Privacy/LetAppsRunInBackground_UserInControlOfTheseApps © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

15 12/5/2018 4:31 AM User Controls © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

16 Privacy User in control Controls all triggers Controls Generic EE
12/5/2018 4:31 AM Privacy User in control Controls all triggers Controls Generic EE Overridden by Group Policy © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

17 Battery Usage Controls
12/5/2018 4:31 AM Battery Usage Controls Different UI per OS Edition Same Group Policy Same developer interface © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

18 Respect User Control and Battery
12/5/2018 4:31 AM Respect User Control and Battery BackgroundAccessStatus backgroundStatus = await BackgroundExecutionManager.RequestAccessAsync(); AlwaysAllowed AllowedSubjectToSystemPolicy DeniedDueToSystemPolicy DeniedByUser BatteryStatus batteryStatus = Battery.AggregateBattery.GetReport().Status; Charging Discharging Idle NotPresent EnergySaverStatus status = PowerManager.EnergySaverStatus; Disabled, Off, On © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

19 Extended Execution Demo
12/5/2018 4:31 AM Extended Execution Demo © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

20 Extended Execution Demo Recap
12/5/2018 4:31 AM Extended Execution Demo Recap Test Lifetime off of the Debugger Extended Execution Session Background Access Status, Battery Status Direct User to Settings App if Needed © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

21 Call to action Build any background scenario you can think of!
12/5/2018 4:31 AM Call to action Build any background scenario you can think of! Check out other Build session recordings on Channel 9. Use the Github samples and tutorials on the next slides. Continue your education at Microsoft Virtual Academy online. Provide Feedback on UserVoice. #MSBuild © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

22 12/5/2018 4:31 AM Related Sessions B8012 – Tips, Tricks and Secrets: Building a Great UWP App for Windows 10 P4050 – Bridges to UWP for Retail Point-Of-Sale Application Developers P4179 – Bluetooth GATT Server in Windows 10 #MSBuild © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

23 12/5/2018 4:31 AM Github Samples Out-Of-Proc Background Task: In-Proc Background Activation: Background Media Playback: Extended Execution: © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

24 Tutorials App Lifecycle: In-Proc Background Task: Group Background Tasks: Background Media Playback: Extended Execution: Best Background Practices:

25 12/5/2018 4:31 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "12/5/2018 4:31 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN."

Similar presentations


Ads by Google