Code example for SchemeRegistry

            // Setting timeout 
            HttpConnectionParams.setConnectionTimeout(params, 100000);
            HttpConnectionParams.setSoTimeout(params, 100000);
            // Registering schemes for both HTTP and HTTPS 
            SchemeRegistry registry = new SchemeRegistry();
            registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
            registry.register(new Scheme("https", sf, 443));
            // Creating thread safe client connection manager 
            ClientConnectionManager ccm = new ThreadSafeClientConnManager(params, registry);
            // Creating HTTP client 
            client = new DefaultHttpClient(ccm, params);
        } catch (Exception e) {
            client = new DefaultHttpClient();
        return client;
Connect your IDE to all the code out there  Get Codota for Java