windows phone 8.1 - Best approach to monitor download progress with OneDrive API on WP8.1? -


i have wp8.1 app using new onedrive api. use c# sdk provided, therefore this:

var dlstream = await connection.downloadstreamforitemasync(mnode.itemreference(),                                                    streamdownloadoptions.default); file = await folder.createfileasync(filename,                                  creationcollisionoption.replaceexisting).astask();  filestream = (await file.openasync(fileaccessmode.readwrite)).asstream();  var v=dlstream.copytoasync(tn.filestream); 

i have not tried yet, seems right way it. concern "how monitor transfer progress , status?"

knowing downloadstreamforitemasync method this:

response = await gethttpresponseasync(request); var responsestream = await response.getresponsestreamasync(); 

i have thought using timer, , each second check stream length,

  1. i don't know if right approach of if there alternative way

  2. i don't know if may not create cross-thread errors stream

  3. how detect transfer failure ?

i guess 1 of approaches re-write partially onedrive sdk portable project, target winrt projects , use windows.web objects instead of system.net, seems work unsure result.

any help? :)

you can use liveconnectclient class inside live sdk instead of downloading file stream , saving file.

  1. use backgrounddownloadasync(string path, uri downloadlocation) method download file

    begins downloading file microsoft onedrive windows phone isolated storage. [windows phone only] file download should continue if app starts file download quits or suspended.

  2. subscribe backgrounddownloadprogresschanged event

    raised @ indeterminate times while file downloading microsoft onedrive windows phone isolated storage. [windows phone only]


hope helps!


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -