background > foregrounddownload.microsoft.com/download/d/c/0/dc06c8ff-ada5-429d-84… · demo...
TRANSCRIPT
![Page 1: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/1.jpg)
background > foreground in Universal Windows Apps on Windows 10
Mike Taulty Microsoft UK @mtaulty
![Page 2: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/2.jpg)
![Page 3: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/3.jpg)
your app spends most of its time here
![Page 4: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/4.jpg)
demo
![Page 5: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/5.jpg)
![Page 6: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/6.jpg)
rich & timely information
many apps
minimum fuss
low bandwidth
all day battery life
![Page 7: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/7.jpg)
![Page 8: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/8.jpg)
![Page 9: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/9.jpg)
use standard system services
and/or
register custom background tasks
![Page 10: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/10.jpg)
![Page 11: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/11.jpg)
extended execution
notifications
background transfers
standard system services
![Page 12: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/12.jpg)
standard system services
extended execution
notifications
background transfers
![Page 13: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/13.jpg)
extended execution
![Page 14: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/14.jpg)
demo
![Page 15: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/15.jpg)
standard system services
extended execution
notifications
background transfers
![Page 16: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/16.jpg)
![Page 17: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/17.jpg)
![Page 18: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/18.jpg)
demo
![Page 19: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/19.jpg)
standard system services
extended execution
notifications
background transfers
![Page 20: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/20.jpg)
use the BackgroundDownloader/Uploader HTTP(S)/FTP for download, HTTP(S) for upload, uses network cost policy, reports progress, failure, etc.
transfers continue when suspended (based on policy)
multiple transfers can be grouped for easier management
success/failure -> automatic tile/toast notifications
app should check transfers at startup time
background transfers
![Page 21: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/21.jpg)
demo
![Page 22: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/22.jpg)
![Page 23: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/23.jpg)
background tasks are custom WinRT components
implement IBackgroundTask
run in the app’s security context
can be many per app
can be sync/async, can report progress and can be cancelled
tasks run when triggers fire & conditions are met
register via BackgroundTaskBuilder & app manifest
background tasks
![Page 24: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/24.jpg)
demo
![Page 25: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/25.jpg)
triggers W
ind
ow
s 8.1
SystemTrigger
TimeTrigger
MaintenanceTrigger
DeviceUseTrigger
DeviceServicingTrigger
PushNotificationTrigger
Pho
ne 8
.1 CachedFileUpdaterTrigger
DeviceConnectionChangeTrigger
GattCharacteristicNotificationTrigger
RfcommConnectionTrigger
LocationTrigger
Win
do
ws 1
0
AppointmentStoreNotificationTrigger
ContactStoreNotificationTrigger
EmailStoreNotificationTrigger
BluetoothLEAdvertisementWatcherTrigger
BluetoothLEAdvertisementPublisherTrigger
DeviceWatcherTrigger
ActivitySensorTrigger
SensorDataThresholdTrigger
ToastNotificationHistoryChangedTrigger
ToastNotificationActionTrigger
ApplicationTrigger
MediaProcessingTrigger
SocketActivityTrigger
![Page 26: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/26.jpg)
conditions
![Page 27: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/27.jpg)
demos push, transfers, action center, sockets
![Page 28: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/28.jpg)
app services
![Page 29: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/29.jpg)
demo app services + Cortana
![Page 30: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/30.jpg)
![Page 31: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/31.jpg)
wall clock time: limited to 25s + 5s
memory: variable limit by device (min 16MB)
network: variable limit by device
also: quiet hours, battery saver can limit background tasks
NB: each time a trigger fires, the quotas get reset
background task constraints
![Page 32: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/32.jpg)
background task constraints
Cancel (5 seconds)
Mem
ory
Run (25 seconds)
Default tasks
Mem
ory
Run (no end)
End (no warning, for now)
Long-running tasks
![Page 33: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/33.jpg)
![Page 34: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/34.jpg)
keep your app alive with notifications
“every” app will have some background tasks
understand triggers/conditions for your app
![Page 35: background > foregrounddownload.microsoft.com/download/D/C/0/DC06C8FF-ADA5-429D-84… · demo app services + Cortana . wall clock time: limited to 25s + 5s memory: variable limit](https://reader033.vdocuments.us/reader033/viewer/2022060423/5f195c0be87013442456c205/html5/thumbnails/35.jpg)