Android HttpAuthHandler - 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 HttpAuthHandler class.

This code example shows how to use the following methods:proceed
	public void onReceivedHttpAuthRequest(WebView view,
			HttpAuthHandler handler, String host, String realm)
	{ 
		 
		if (this.username != null && this.password != null) {
			handler.proceed(this.username, this.password);
		} 
	} 
 
	public void setBasicAuthentication(String username, String password)
	{ 
		this.username = username;
		this.password = password;
	} 
 
	@Override 
	public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error)
	{ 
		/* 
		 * in theory this should be checked to make sure it's not null but if there is some failure  
7
CodeRank
This code example shows how to use the following methods:proceed
        } 
 
        @Override 
        public void onReceivedHttpAuthRequest(WebView view,
                HttpAuthHandler handler, String host, String realm) {
            handler.proceed(httpuser, httppassword);
        } 
    } 
 
 
    protected class JavaScriptInterface { 
        Context mContext;
 
        /** Instantiate the interface and set the context */ 
        JavaScriptInterface(Context c) {
            mContext = c;
        } 
 
        @JavascriptInterface 
        public void setTopicTitle(String topicTitle) {
6
CodeRank
This code example shows how to use the following methods:cancel
     * @param realm the realm for which authentication is required 
     * @see Webview#getHttpAuthUsernamePassword 
     */ 
    public void onReceivedHttpAuthRequest(WebView view,
            HttpAuthHandler handler, String host, String realm) {
        handler.cancel();
    } 
 
    /** 
     * Give the host application a chance to handle the key event synchronously. 
     * e.g. menu shortcut key events need to be filtered this way. If return 
     * true, WebView will not handle the key event. If return false, WebView 
     * will always handle the key event, so none of the super in the view chain 
     * will see the key event. The default behavior returns false. 
     * 
     * @param view The WebView that is initiating the callback. 
     * @param event The key event. 
     * @return True if the host application wants to handle the key event 
     *         itself, otherwise return false 
     */ 
5
CodeRank
This code example shows how to use the following methods:proceed
    	MyLog.d(TAG, "onReceivedHttpAuthRequest: host => " + host + ", realm => "
                + realm);
        String[] up = webView.getHttpAuthUsernamePassword(host, realm);
 
        if (up != null && up.length == 2 && up[0] != null && up[1] != null) {
            handler.proceed(up[0], up[1]);
        } else { 
            super.onReceivedHttpAuthRequest(webView, handler, host, realm);
        } 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:cancel
 
        @Override 
        public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host,
                String realm) {
            // cancel http auth request 
            handler.cancel();
        } 
 
        @Override 
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            pageStartCount++;
            Log.v(LOGTAG, "onPageStarted: " + url);
        } 
 
        @Override 
        public void onPageFinished(WebView view, String url) {
            Log.v(LOGTAG, "onPageFinished: " + url);
            // let handleTimeout take care of finishing the page 
            if(!timeoutFlag)
                handler.postDelayed(new WebViewStatusChecker(), 500);
5
CodeRank
This code example shows how to use the following methods:proceed
 
        // get the authentication token 
        AuthenticationToken token = mPage.getRunTime().getAuthenticationToken(host, realm);
 
        if (token != null) {
            handler.proceed(token.getUserName(), token.getPassword());
        } 
    } 
 
    @Override 
    public void onPageStarted(WebView view, String url, Bitmap favicon) {
        LOG.d("WebAppLog", "load start   :" + System.currentTimeMillis());
        //mPage.getRunTime().getWebServer().addInjectUrl(url); 
        if (url.startsWith("http://")||url.startsWith("https://")) {
            String msg = mPage.getRunTime().getResources().getString(R.string.PleaseWait);
            mPage.getRunTime().openProgress(mPage.getContext(),msg,true);
        } 
        // Clear history so history.back() doesn't do anything.   
        // So we can reinit() native side CallbackServer & PluginManager. 
        //        view.clearHistory();  
3
CodeRank
This code example shows how to use the following methods:proceed
		} 
 
		@Override 
		public void onReceivedHttpAuthRequest(WebView view,
				HttpAuthHandler handler, String host, String realm) {
			handler.proceed(httpuser, httppassword);
		} 
	} 
	 
	 
	protected class JavaScriptInterface { 
	    Context mContext;
 
	    /** Instantiate the interface and set the context */ 
	    JavaScriptInterface(Context c) {
	        mContext = c;
	    } 
 
	    public void setTopicTitle(String topicTitle) {
	    	updateTopicTitleListener.updateTopicTitle(topicTitle);
4
CodeRank
This code example shows how to use the following methods:proceed
	public void onReceivedHttpAuthRequest(WebView view,
			HttpAuthHandler handler, String host, String realm)
	{ 
		 
		if (this.username != null && this.password != null) {
			handler.proceed(this.username, this.password);
		} 
	} 
 
	public void setBasicAuthentication(String username, String password)
	{ 
		this.username = username;
		this.password = password;
	} 
 
	@Override 
	public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error)
	{ 
		/* 
		 * in theory this should be checked to make sure it's not null but if there is some failure  
4
CodeRank
This code example shows how to use the following methods:proceed
	@Override 
	public void onReceivedHttpAuthRequest(WebView view,
			HttpAuthHandler handler, String host, String realm) {
		 
		if (this.username != null && this.password != null) {
			handler.proceed(this.username, this.password);
		} 
	} 
	 
	public void setBasicAuthentication(String username, String password) {
		this.username = username;
		this.password = password;
	} 
} 
4
CodeRank
This code example shows how to use the following methods:proceed
        } 
 
        @Override 
        public void onReceivedHttpAuthRequest(WebView view,
                HttpAuthHandler handler, String host, String realm) {
            handler.proceed(blog.getHttpuser(), blog.getHttppassword());
        } 
    } 
 
    /** 
     * WebChromeClient that displays "Loading..." title until the content of the webview is fully 
     * loaded. 
     */ 
    protected class WordPressWebChromeClient extends WebChromeClient {
        private Context context;
        private CharSequence title;
 
        public WordPressWebChromeClient(Context context, CharSequence title) {
            this.context = context;
            this.title = title;
4
CodeRank

Related Android HttpAuthHandler Questions & Answers:

See Code Examples for Android HttpAuthHandler Methods: