- Home /
WebClient on Android
Howdy folks,
So I have run into a bit of an issue with my app. I have a bunch of textures that get loaded off a server and these texture change daily. In the main menu I need to download a minimum of 10 fairly large textures. Using WWW does eventually download all the textures but its ridiculously slow and freezes up the responsiveness of the app. I came up with a pretty nice solution where I spawn a couple of threads and using WebClient I download the textures. This was great and most importantly it does not freeze up the app. However an issue that I have ran into is I have no way of getting WebClient to work on android. The code works 100% in the editor and on a iOS device, but fails miserably on Android. Has anyone successfully used WebClient on Android??
This is the error I am seeing on Android:
I/Unity (14191): System.Net.WebException: Error: ConnectFailure (Connection refused) ---> System.Net.Sockets.SocketException: Connection refused I/Unity (14191): at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in :0 I/Unity (14191): at System.Net.WebConnection.Connect (System.Net.HttpWebRequest request) [0x00000] in :0 I/Unity (14191): --- End of inner exception stack trace --- I/Unity (14191): at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00000] in :0 I/Unity (14191): at System.Net.HttpWebRequest.GetResponse () [0x00000] in :0
I have tried using a proxy that was suggested here: http://answers.unity3d.com/questions/801602/how-can-i-use-webclient-to-download-files-on-andro.html. But whenever I request for the proxy host and port from the android activity (via JNI) I get nothing.
Thanks!
Your answer
Follow this Question
Related Questions
WWW.audioClip not playing on android build 1 Answer
WWW with https resulting in SSL: couldn't create a context 0 Answers
Distribute terrain in zones 3 Answers
Oculus OVR 0 Answers