Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

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 (7.0.1.2) 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?

Thanks.

Sign In or Register to comment.