-4

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.

Scoregraphic
  • 7,110
  • 4
  • 42
  • 64
Marian Paździoch
  • 8,813
  • 10
  • 58
  • 103
  • You should avoid questions that ask for vague things, as in, things that don't have an objective answer. Things you shouldn't ask: - What do you recommend, - What do you think, - Any hints on, Take a look at the guidelines: http://stackoverflow.com/help/dont-ask – DallaRosa Mar 27 '14 at 08:34

2 Answers2

0

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

playmaker420
  • 1,527
  • 4
  • 27
  • 52
  • The question is asking how long should be the time out, not the measurement to be used. – DallaRosa Mar 27 '14 at 07:35
  • My bad .What i meant was to give an extreme limit as 15 secs n 10 secs respectively – playmaker420 Mar 27 '14 at 07:41
  • http://stackoverflow.com/questions/3972345/java-reasonable-timeout-period-for-urlconnection Check whether this helps – playmaker420 Mar 27 '14 at 07:44
  • Fix your answer and I'll remove the downvote. Another thing is, do you really want to leave your user hanging on for 15 seconds before saying anything? In my opinion 1 to 3 secs is the best balance. – DallaRosa Mar 27 '14 at 07:45
  • 2
    Actually I don't even think this is a valid SO question cause it's not asking for something that can be answered objectively. – DallaRosa Mar 27 '14 at 07:46
  • Answer edited.Ya i know its kind of high value.the reason why i give such a large value is when it comes to slow speed internet connection i think it might help not to disconnect.I could be wrong.Still i prefer that – playmaker420 Mar 27 '14 at 07:56
0

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

Marian Paździoch
  • 8,813
  • 10
  • 58
  • 103