سؤال

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.

هل كانت مفيدة؟

المحلول 2

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

نصائح أخرى

You can give any value I usually give 15 seconds.You can give any value

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top