Search code examples
androidapache-commons-httpclientconnection-timeout

What timeout set for apache http client?


I'm using apache http client

import org.apache.http.impl.client.DefaultHttpClient;
//...
my_httpParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(my_httpParams, 300);
HttpConnectionParams.setSoTimeout(my_httpParams, 300);
httpclient = new DefaultHttpClient(my_httpParams);

for fetching name matching calling number from services like http://klicktel.de/ (reverse number lookup, using in Android Call Log for example). As you can see I set timeout to 300ms for both connection and socket timeout.

Do you have any hints what timeout should be set to be reasonable? I mean: user want to see the reversed-number but on the other hand user don't want to wait indefinitely for the number to be fetched.


Solution

  • I've found AndroidHttpClient which seems to answer my question:

    Implementation of the Apache DefaultHttpClient that is configured with reasonable default settings and registered schemes for Android