Table of contents
TOC
Collapse the table of content
Expand the table of content

Launching, resuming, and background tasks

Last Updated: 10/21/2016

[ Updated for UWP apps on Windows 10. For Windows 8.x articles, see the archive ]

This section describes the following:

  • What happens when a Universal Windows Platform (UWP) app is started, suspended, resumed, and terminated.
  • How to activate apps by using a contract or extension.
  • How to use background tasks which allow a UWP app to do work even when the app is not in the foreground.
  • App services, which allow your Universal Windows Platform (UWP) app to provide services that can be consumed from other UWP apps so that you can build apps that build off of each other.
  • How to discover connected devices, launch an app on another device, and communicate with an app on a remote device so that you can create user experiences that flow across devices.
  • How to add a splash screen to your app.

The app lifecycle

TopicDescription
App lifecycleLearn about the life cycle of a UWP app and what happens when Windows launches, suspends, and resumes your app.
Handle app prelaunchLearn how to handle app prelaunch.
Handle app activationLearn how to handle app activation.
Handle app suspendLearn how to save important application data when the system suspends your app.
Handle app resumeLearn how to refresh displayed content when the system resumes your app.
Free memory when your app moves to the backgroundLearn how to reduce the amount of memory that your app uses when it is in the background state so that it won't be terminated.

Launch apps

URI and File activationDescription
Connected apps and devices (Project "Rome")Learn how to discover connected devices, launch an app on another device, and communicate with an app on a remote device.
Launch an app for resultsLearn how to launch an app from another app and exchange data between the two.
Launch the default app for a URILearn how to launch the default app for a Uniform Resource Identifier (URI).
Launch an app on a remote deviceLearn how to launch an app for a URI on a remote device.
Handle URI activationLearn how to register an app to become the default handler for a URI scheme name.
Support web-to-app linking with app Uri handlersLearn how to register an app to be the default handler for a http or https link.
Launch the default app for a fileLearn how to launch the default app for a file type.
Handle file activationLearn how to register your app to be the default handler for a file type.
Reserved file and URI scheme namesThis topic lists the reserved file and URI scheme names that are not available to your app.
Auto-launching with AutoPlayLearn how to use AutoPlay to provide your app as an option when a user connects a device to their PC.
Launch the Windows Settings appLearn how to launch the Windows Settings app.
Launch the Windows Store appLearn how to launch the Windows Store app.
Launch the Windows Maps appLearn how to launch the Windows Maps app.
Launch the Windows People appLearn how to launch the Windows People app.

Background tasks

TopicDescription
Support your app with background tasksThe topics in this section show how to run your own lightweight code in the background by responding to triggers with background tasks.
Access sensors and devices from a background taskDeviceUseTrigger lets your Universal Windows app access sensors and peripheral devices in the background, even when your foreground app is suspended.
Guidelines for background tasksEnsure your app meets the requirements for running background tasks.
Create and register an out-of-process background taskCreate and register a background task that that runs in a separate process from your app, and register it to run when your app is not in the foreground.
Create and register an in-process background taskCreate and register a background task that runs in the same process as your foreground app.
Convert an out-of-process background task to an in-process background taskLearn how to convert an out-of-process background task into an in-process background task that runs in the same process as your foreground app.
Debug a background taskLearn how to debug a background task, including background task activation and debug tracing in the Windows event log.
Declare background tasks in the application manifestEnable the use of background tasks by declaring them as extensions in the app manifest.
Handle a cancelled background taskLearn how to make a background task that recognizes cancellation requests and stops work, reporting the cancellation to the app using persistent storage.
Monitor background task progress and completionLearn how your app can recognize background task progress and completion.
Register a background taskLearn how to create a function that can be re-used to safely register most background tasks.
Respond to system events with background tasksLearn how to create a background task that responds to SystemTrigger events.
Run a background task on a timerLearn how to schedule a one-time background task, or run a periodic background task.
Set conditions for running a background taskLearn how to set conditions that control when your background task will run.
Transfer data in the backgroundUse the background transfer API to copy files in the background.
Update a live tile from a background taskUse a background task to update your app's live tile with fresh content.
Use a maintenance triggerLearn how to use the MaintenanceTrigger class to run lightweight code in the background while the device is plugged in.

App services

TopicDescription
Create and consume an app serviceLearn how to write a UWP app that can provide services to other UWP apps, and how to consume those services.
Communicate with a remote app serviceLearn how to exchange messages with an app service running on a remote device.
Convert an app service to run in the same process as its host appLearn how to Convert app service code that runs in a separate background process into code that runs inside the same process as the app that hosts your app service.

Add a splash screen

All UWP apps must have a splash screen, which is a composite of a splash screen image and a background color, both of which can be customized.

Your splash screen is displayed immediately when the user launches your app. This provides immediate feedback to users while app resources are initialized. As soon as your app is ready for interaction, the splash screen is dismissed.

A well-designed splash screen can make your app more inviting. Here's a simple, understated splash screen:

a 75% scaled screen capture of the splash screen from the splash screen sample.

This splash screen is created by combining a green background color with a transparent PNG.

Putting an image and background color together to form the splash screen helps the splash screen look good, regardless of the device your app is installed on. When the splash screen is displayed, only the size of the background changes to compensate for a variety of screen sizes. Your image always remains intact.

Additionally, you can use the SplashScreen class to customize your app's launch experience. You can position an extended splash screen, which you create, to give your app more time to complete additional tasks like preparing app UI or completing networking operations. You can also use the SplashScreen class to notify you when the splash screen is dismissed, so that you can begin entrance animations.

TopicDescription
Add a splash screenSet your app's splash screen image and background color.
Display a splash screen for more timeDisplay a splash screen for more time by creating an extended splash screen for your app. This extended screen imitates the splash screen shown when your app is launched, and can be customized.
© 2016 Microsoft