HttpConnectionParams.setStaleCheckingEnabled(params, false);
ConnManagerParams.setMaxTotalConnections(params, 5);
ConnManagerParams.setMaxConnectionsPerRoute(params,
new ConnPerRouteBean(5));
SchemeRegistry supportedSchemes = new SchemeRegistry();
SocketFactory sf = PlainSocketFactory.getSocketFactory();
supportedSchemes.register(new Scheme("http", sf, 80));
ThreadSafeClientConnManager mgr = new ThreadSafeClientConnManager(
params, supportedSchemes);
DefaultHttpClient client = new DefaultHttpClient(mgr, params);