Using the following solved my problem

 public HttpResponse getResp(String request) throws IOException

{

 HttpGet httpGet = new HttpGet(request);

HttpParams httpParameters = new BasicHttpParams();

// Set the timeout in milliseconds until a connection is established.

// The default value is zero, that means the timeout is not used.

int timeoutConnection = 30000;

HttpConnectionParams.setConnectionTimeout(httpParameters,
timeoutConnection);

// Set the default socket timeout (SO_TIMEOUT)

// in milliseconds which is the timeout for waiting for data.

int timeoutSocket = 40000;

HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);

DefaultHttpClient httpClient = new DefaultHttpClient(httpParameters);

HttpResponse response = httpClient.execute(httpGet);

return response;

}

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to