Background Transfer Service in the "Tidy" application

Version: 1.0.0

Description

Windows Phone codenamed "Mango" introduces the new Background Transfer Service multitasking feature to transfer files even when your application is not running. This hands-on-lab will show you how to use this feature to transfer (upload and download) data between your Windows Phone application and a server on the Internet. It will also show you how to schedule transfers, query their progress, and manage your download queue.

Overview

When writing your Windows® Phone Codenamed Mango application, you may need to transfer files from and to the application. While your application may need those files in order to function, there are some cases when those files can be downloaded asynchronously, notifying the application when the transfer is complete. Such scenarios include downloading big files (music and video files), uploading some lengthy reports to a server or backing up the application’s database.

One of the many new features of Windows® Phone Codenamed Mango is the ability to run the file transfer task at the background and get notifications about transfer progress. An important part of this feature is that the transfer remains active even if the application becomes dormant or even terminated.

This lab shows how to add background transfer services to your application using the new Windows® Phone Codenamed Mango API and demonstrates how to handle the BackgroundTransferService requests.

Objectives

This lab provides instructions to help you achieve the following:

  • Add background transfers (upload and download) to your Windows® Phone application.
  • Understand how to work with BackgroundTransferService and manage your application’s requests.

Prerequisites

The following prerequisites are required to gain most can be gained from this hands-on lab:

  • You should install Microsoft Visual Studio 2010 or Microsoft Visual C# Express 2010, and the Windows® Phone Developer Tools available at https://go.microsoft.com/?linkid=9772716
  • You should have previous knowledge on application development for the Windows® Phone 7.

Lab Structure

This lab includes a single exercise. The following tasks are contained in the exercise:

  1. Creating a Sync service to the application and implementing the database backup/restore logic.
  2. Implementing the user interface to backup/restore the database.

Estimated completion time

Completing this lab should take between 30 to 45 minutes.