Forum Xamarin.Android

WebClient doesn't work properly on Android anymore

timutimu USMember ✭✭
edited October 2016 in Xamarin.Android

Hi everyone,

I am using WebClient's DownloadDataAsync function to download a pdf. But with the latest update to Xamarin Android ( I suppose, download operation seems like starts without any exception but didn't progress or finish. When I change the function to DownloadData after a while request times out and throw exception.

I tried to change it into HttpWebRequest but same thing happened with that too.

Only solution for me to add System.Net reference to my Android project and use HttpClient's GetByteArrayAsync function. This works without a problem and downloads PDF. However I couldn't show download progress since returning Task doesn't have Progress. 0

Does anyone have a better idea to solve this problem? Maybe a setting for WebClient instance?


Sign In or Register to comment.