This is because sometimes your server takes too long to respond. In fact, this can also be due to a slow network, so you do not have full control over it. If you used HttpClient , you could increase the wait period:
HttpParams httpParameters = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParameters, CONNECTION_TIMEOUT);
HttpConnectionParams.setSoTimeout(httpParameters, WAIT_RESPONSE_TIMEOUT);
HttpConnectionParams.setTcpNoDelay(httpParameters, true);
client = new DefaultHttpClient(httpParameters);
CONNECTION_TIMEOUT- timeout to establish a connection. WAIT_RESPONSE_TIMEOUT- waiting time to receive data - in your case, this is what you need to increase.
Bottom line:
- URL- HttpClient.
- , , , . - , . , , .