i found the answer

thanks you all for your help :)

HttpParams my_httpParams = new BasicHttpParams();
                        HttpConnectionParams.setConnectionTimeout(my_httpParams,
connection_Timeout);
                        HttpConnectionParams.setSoTimeout(my_httpParams,
connection_Timeout);
                        HttpClient httpClient = new 
DefaultHttpClient(my_httpParams);  //
get http client with given params

On Jun 3, 2:17 pm, RTX <[email protected]> wrote:
> Hi
>
> How do i set the timeout to the HttpClient
> here is the code im using
>
> please help me i need to kill the request if its taking to long
> otherwise its openning a Force Close
>
> HttpClient httpClient = new DefaultHttpClient();
>                 InputStream result = null;
>                 try
>                 {
>                         String url = ".......";
>                         Log.d(tag, "HttpGet " + url);
>                         HttpGet method = new HttpGet(new URI(url));
>                         HttpResponse response = httpClient.execute(method);
>                         if (response != null)
>                         {
>
>                                 result = response.getEntity().getContent();
>                         }
>                 }
>                 catch(Exception e)
>                 {
>                         Log.e(tag,e.getMessage(),e);
>                 }
>                 return result;
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to