Android ProxySelectorRoutePlanner - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ProxySelectorRoutePlanner class.

This code example shows how to use the following methods:
    HttpConnectionParams.setStaleCheckingEnabled(params, true);
    return params;
  } 
 
  public HttpRoutePlanner getRoutePlanner(SchemeRegistry registry) {
    return new ProxySelectorRoutePlanner(registry, ProxySelector.getDefault());
  } 
 
  public HttpParams getGridHttpParams(int connection_timeout, int socket_timeout){
    final HttpParams params = getHttpParams();
    HttpConnectionParams.setSoTimeout(params, socket_timeout > 0 ? socket_timeout : TIMEOUT_THREE_HOURS);
    HttpConnectionParams.setConnectionTimeout(params, connection_timeout > 0 ? connection_timeout : 120 * 1000);
    return params;
  } 
 
  public void close() { 
    httpClient.getConnectionManager().shutdown();
    gridClientConnectionManager.shutdown();
  } 
 
6
CodeRank
This code example shows how to use the following methods:
        HttpContext localContext = new BasicHttpContext();
        HttpGet httpget = new HttpGet(url);
 
        // retrieve local java configured network in case there is the need to 
        // authenticate a proxy 
        ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(
                    httpClient.getConnectionManager().getSchemeRegistry(),
                    ProxySelector.getDefault());
        httpClient.setRoutePlanner(routePlanner);
 
        boolean trying = true;
        // loop while the response is being fetched 
        while (trying) {
            // connect and get status code 
            HttpResponse response = httpClient.execute(httpget, localContext);
            int statusCode = response.getStatusLine().getStatusCode();
 
            // check whether any authentication is required 
            AuthState authenticationState = null;
            if (statusCode == HttpStatus.SC_UNAUTHORIZED) {
4
CodeRank
This code example shows how to use the following methods:
        DefaultHttpClient httpClient = new DefaultHttpClient(mgr, client.getParams());
 
        // Set verifier      
        HttpsURLConnection.setDefaultHostnameVerifier(hostnameVerifier);
		 
		ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(client.getConnectionManager().getSchemeRegistry(), ProxySelector.getDefault());
		client.setRoutePlanner(routePlanner);
 
		String baseUrl = serverUrl + "/tikitag-web/rest/oauth";
		return new CommonsHttpOAuthProvider(baseUrl + "/request-token", baseUrl + "/access-token", baseUrl + "/authorize", client);
	} 
 
	private void showAuthorizeDialog(String authorizeUrl){
//		Dialog dialog = new Dialog(ctx); 
//		dialog.setContentView(R.layout.authorize_webview); 
//		dialog.setTitle("Authorize"); 
//		 
//		webView = (WebView)dialog.findViewById(R.id.webView); 
//		 
//		dialog.show(); 
4
CodeRank
This code example shows how to use the following methods:
        return connmgr;
    } 
 
    @Override 
    protected HttpRoutePlanner createHttpRoutePlanner() {
        return new ProxySelectorRoutePlanner(getConnectionManager().getSchemeRegistry(),
                ProxySelector.getDefault());
    } 
 
    @Override 
    protected ConnectionReuseStrategy createConnectionReuseStrategy() {
        final String s = System.getProperty("http.keepAlive", "true");
        if ("true".equalsIgnoreCase(s)) {
            return new DefaultConnectionReuseStrategy();
        } else { 
            return new NoConnectionReuseStrategy();
        } 
    } 
 
} 
4
CodeRank
This code example shows how to use the following methods:
        if (theProxyHost != null && theProxyHost.length() > 0) {
            // Configure the host and port 
            HttpHost proxy = new HttpHost(theProxyHost, theProxyPort == null ? -1 : theProxyPort.intValue());
            ConnRouteParams.setDefaultProxy(params, proxy);
        } 
        ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(
                client.getConnectionManager().getSchemeRegistry(),
                ProxySelector.getDefault());
                ((AbstractHttpClient) client).setRoutePlanner(routePlanner);
    } 
 
    /** 
     * When this WebResource is no longer needed it should be shutdown to return 
     * underlying resources back to the OS. 
     */ 
    public void shutdown() { 
        client.getConnectionManager().shutdown();
    } 
 
    /** 
4
CodeRank
This code example shows how to use the following methods:
        return connmgr;
    } 
 
    @Override 
    protected HttpRoutePlanner createHttpRoutePlanner() {
        return new ProxySelectorRoutePlanner(getConnectionManager().getSchemeRegistry(),
                ProxySelector.getDefault());
    } 
 
    @Override 
    protected ConnectionReuseStrategy createConnectionReuseStrategy() {
        String s = System.getProperty("http.keepAlive");
        if ("true".equalsIgnoreCase(s)) {
            return new DefaultConnectionReuseStrategy();
        } else { 
            return new NoConnectionReuseStrategy();
        } 
    } 
 
} 
4
CodeRank
See Code Examples for Android ProxySelectorRoutePlanner Methods: