Code example for PlainSocketFactory

0
     */ 
    public final HttpClient getHttpClient() {
 
        if (httpClient == null) {
            final SchemeRegistry registry = new SchemeRegistry();
            registry.register(new Scheme("http", new PlainSocketFactory(), 80));
            registry.register(new Scheme("https", new PlainSocketFactory(), 443));
 
            final HttpParams cxParams = new BasicHttpParams();
            ConnManagerParams.setMaxTotalConnections(cxParams, 5);
            HttpConnectionParams.setConnectionTimeout(cxParams, 60000);
            final ThreadSafeClientConnManager connexionManager = new ThreadSafeClientConnManager(
                    cxParams, registry);
 
            final String appVersion = VersionUtils.getCurrent(this);
            final String userAgent = String.format(
                    "ItineRennes/%s (Android/%s; SDK %s; %s; %s)", appVersion,
                    android.os.Build.VERSION.RELEASE,
                    android.os.Build.VERSION.SDK_INT, android.os.Build.MODEL,
                    android.os.Build.DEVICE);