Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
background > foreground in Universal Windows Apps on Windows 10
Mike Taulty Microsoft UK @mtaulty
your app spends most of its time here
demo
rich & timely information
many apps
minimum fuss
low bandwidth
all day battery life
use standard system services
and/or
register custom background tasks
extended execution
notifications
background transfers
standard system services
standard system services
extended execution
notifications
background transfers
extended execution
demo
standard system services
extended execution
notifications
background transfers
demo
standard system services
extended execution
notifications
background transfers
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
demo
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
demo
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
conditions
demos push, transfers, action center, sockets
app services
demo app services + Cortana
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
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
keep your app alive with notifications
“every” app will have some background tasks
understand triggers/conditions for your app