Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9008277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:54:18+00:00 2026-06-16T01:54:18+00:00

I am using a webview to load a webpage which requires basic HTTP authentication.

  • 0

I am using a webview to load a webpage which requires basic HTTP authentication. I have done some Google search and I knew it can be done by using a WebClientView and over-writing onReceivedHttpAuthRequest.

like this

webView.setWebViewClient(new WebViewClient() {

        public void onReceivedHttpAuthRequest(WebView view,
        HttpAuthHandler handler, String host, String realm)        {
            // TODO Auto-generated method stub

      handler.proceed(username, password); //question is here,let user input these. 
        }
    });

what I have already tried is I use a Login activity to get the users’s input and pass the parameter back to this webview activity.

But is this the best way of doing it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:54:19+00:00Added an answer on June 16, 2026 at 1:54 am

    try this method with HttPget and HttpPost

            CredentialsProvider credProvider = new BasicCredentialsProvider();
    
            credProvider.setCredentials(new AuthScope(AuthScope.ANY_HOST, 
    
            AuthScope.ANY_PORT,AuthScope.ANY_REALM),  new UsernamePasswordCredentials("admin", 
           "guest"));
    
            httpclient.setCredentialsProvider(credProvider);
            Log.w("SENCIDE", "Execute HTTP Get Request");
            HttpResponse response = httpclient.execute(httpget);
    

    This is sample code for Authentication code in Httpget . You can try by this w’t you want…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently using a webview to load a webpage which contains lots of
I have a WebView in my app and I load http://mysite.com/somepage.php I know I
In my application, i have some external urls to load, for which i am
In android I'm using WebView to display a part of a webpage which I
i am using a webview to load some content in one activity, and then
I know how to load site's content in Android using WebView (webview.loadUrl(http://slashdot.org/);) And how
I have an Android app using webview to load and display html pages. But
I have a webview and I load some html5+js into it. My webapp is
I load a web page by using WebView in my app and there are
I am using a webview to load an image from an URL, but when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.