code: public static AndroidHttpClient newInstance(String userAgent) {
      HttpParams params = new BasicHttpParams();
  
      // Turn off stale checking. Our connections break all the time anyway,
      // and it's not worth it to pay the penalty of checking every time.
      HttpConnectionParams.setStaleCheckingEnabled(params, false);
  
      // Default connection and socket timeout of 20 seconds. Tweak to taste.
      HttpConnectionParams.setConnectionTimeout(params, 20 * 1000);
      HttpConnectionParams.setSoTimeout(params, 20 * 1000);
      HttpConnectionParams.setSocketBufferSize(params, 8192);
  
      // Don't handle redirects -- return them to the caller. Our code
      // often wants to re-POST after a redirect, which we must do ourselves.
      HttpClientParams.setRedirecting(params, false);
  
      // Set the specified user agent and register standard protocols.
      HttpProtocolParams.setUserAgent(params, userAgent);
      SchemeRegistry schemeRegistry = new SchemeRegistry();
      schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
      schemeRegistry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
      ClientConnectionManager manager = new ThreadSafeClientConnManager(params, schemeRegistry);
  
      // We use a factory method to modify superclass initialization
      // parameters without the funny call-a-static-method dance.
      return new AndroidHttpClient(manager, params);
    }
docs: Create a new HttpClient with reasonable defaults (which you can update).
  
  @param userAgent to report in your HTTP requests.
  @return AndroidHttpClient for you to use for all your requests.