Here you can find the source of getHttpClient()
private static HttpClient getHttpClient()
//package com.java2s; import org.apache.http.client.HttpClient; import org.apache.http.conn.params.ConnManagerParams; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.params.HttpConnectionParams; import org.apache.http.params.HttpParams; public class Main { /** The time it takes for our client to timeout */ public static final int HTTP_TIMEOUT = 10 * 1000; /** Single instance of our HttpClient */ private static HttpClient httpClient; /**// w ww.j a v a 2 s . co m * Get singleton of HttpClient object. * * @return an HttpClient object with connection parameters set */ private static HttpClient getHttpClient() { if (httpClient == null) { httpClient = new DefaultHttpClient(); final HttpParams params = httpClient.getParams(); HttpConnectionParams.setConnectionTimeout(params, HTTP_TIMEOUT); HttpConnectionParams.setSoTimeout(params, HTTP_TIMEOUT); ConnManagerParams.setTimeout(params, HTTP_TIMEOUT); } return httpClient; } }