1

I am using HttpURLConnection. When I set the timeout to 1 minute, a sequence of asynctasks takes almost 12 seconds to load completely. But when I reduce the timeout value to 6 seconds, the sequence loads results in almost 8 seconds.

By sequence of asynctasks I mean that I have a series of server calls that are executed whenever a user launches my application.

Reducing the timeout value gives me quicker results. This has happened with other people also as mentioned here: httpurlconnection is very slow on Android 4.2

Can anybody explain what's the reason behind this?

Community
  • 1
  • 1
allstraws
  • 129
  • 3
  • 12
  • I know that this doesn't answer your question, but given that you have to do nested api calls, I recommend you to try this instead of having a sequence of AsyncTasks: http://joluet.github.io/blog/2014/07/07/rxjava-retrofit/ – Daniel Ocampo Sep 21 '15 at 13:30

0 Answers0