windows-phone-8onedrivewindows-phone-8-emulatorlive-sdkwindows-phone-7.8

Downloading Multiple Files from SkyDrive with Live 5.3


I'm trying to download one or more files from SkyDrive using the Windows Phone emulator. I'm pretty new at the Live SDK and I'm lost following these pages:

multiple file download using SkyDrive API

https://msdn.microsoft.com/en-us/library/live/hh826531.aspx#downloading_files

They both use methods and classes not provided in Live SDK 5.3 (more specifically, client.DownloadCompleted and LiveDownloadCompletedEventArgs).


Solution

  • You must be using Windows Phone 8.0 SDK. DownloadCompleted and LiveDownloadCompletedEventArgs are part of the Microsoft.Live namespace on WP7.1.

    In Windows Phone 8.0 DownloadAsync() is used with the await keyword. You can use it with or without progress notification.

    Sample:

    var result = await client.DownloadAsync(path); // path will be file id followed by '/content'
    var stream = result.Stream;