Here you can find the source of maybeCreateHttpClient()
public static void maybeCreateHttpClient()
//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 { public static final int REGISTRATION_TIMEOUT = 30 * 1000; protected static HttpClient mHttpClient; /**/*from ww w . j a va2 s.co m*/ * Configures the httpClient to connect to the URL provided. */ public static void maybeCreateHttpClient() { if (mHttpClient == null) { mHttpClient = new DefaultHttpClient(); final HttpParams params = mHttpClient.getParams(); HttpConnectionParams.setConnectionTimeout(params, REGISTRATION_TIMEOUT); HttpConnectionParams.setSoTimeout(params, REGISTRATION_TIMEOUT); ConnManagerParams.setTimeout(params, REGISTRATION_TIMEOUT); } } }