Search code examples
windows-phone-7windows-phone-7.1background-agents

How to switch from foreground application to background agent?


I'd like to know if it is possible to switch from foreground app to background agent and vice-versa sharing some data from these two tasks?

More in deep I'd like to do an upload that starts from foreground (Fig. A) and when the user pushes back button the upload continues with background agent (Fig. B).

Image is here: http://imageshack.us/f/823/testter.jpg/


Solution

  • Background file transfer is what you need. It can upload (and download) files while the application is not running:

    With Windows Phone OS 7.1, applications are able to queue up one or more file uploads or downloads over HTTP that will be executed in the background, even when the application is no longer running in the foreground. The APIs used for initiating file transfers should be used to query the status existing transfers and provide progress indicators for the end user.