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,
i don't know if right approach of if there alternative way
i don't know if may not create cross-thread errors stream
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.
use
backgrounddownloadasync(string path, uri downloadlocation)method download filebegins downloading file microsoft onedrive windows phone isolated storage. [windows phone only] file download should continue if app starts file download quits or suspended.
subscribe
backgrounddownloadprogresschangedeventraised @ indeterminate times while file downloading microsoft onedrive windows phone isolated storage. [windows phone only]
hope helps!
Comments
Post a Comment