Code example for ThreadSafeClientConnManager

0
		HttpProtocolParams.setContentCharset(params, HTTP.DEFAULT_CONTENT_CHARSET);
 
		SchemeRegistry schReg = new SchemeRegistry();
		schReg.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
		schReg.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
		ClientConnectionManager conMgr = new ThreadSafeClientConnManager(params, schReg);
 
		return new DefaultHttpClient(conMgr, params);
	} 
 
	public void clearCookies() { 
		httpClient.getCookieStore().clear();
	} 
 
	public void abort() { 
		try { 
			if (httpClient != null) {
				Log.i(TAG, "Abort.");
				httpPost.abort();
			} 
Connect your IDE to all the code out there  Get Codota for Java