Background activity improvements to help developers in the Windows 10 Anniversary Update
Microsoft introduces a new background activity mechanism
Third-party developers can use a simplified method to enable background activity for their Universal apps. This will be possible after the Anniversary Update in July, as Microsoft will provide a new option for the background processes. The current Windows apps require creating a background task as a separate process, but after the Update the background agent won’t be required.
The new mechanisms for developers for a single process model will enhance the app lifecycle and improve the efficiency of the foreground & background operations.
Interested in running your application in the background? A new developer option available in the Windows 10 Anniversary Update just made background activity a whole lot easier. Your feedback was clear on the multiple process model: while doing background work in a separate process was more resilient, it required significantly more code to implement. From this feedback we are able to provide a new option, a simplified method for enabling background activity without creating a background task. Now developers have the choice of running code in the background as either a separate process or directly inside the foreground application. We’ll cover the basics for all the tools which utilize the single process model:
- Background Triggers
- App Services
- Background media playback using Activity Sponsored Execution.
- Extended Execution
The single process model enhances the application lifecycle with improved notifications for when your app is in the foreground or in the background. Two new events are available from the Application object for these transitions: EnteredBackground and LeavingBackground. These events fit into the application lifecycle based on the visibility state of your application.
These new developer options will be avalable after July 2016, while phones that will benefit from future UWP apps should run at least Redstone builds – 14xxx or higher.