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 8302187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:13:17+00:00 2026-06-08T17:13:17+00:00

I am trying to set up an Android app where I can access URL’s

  • 0

I am trying to set up an Android app where I can access URL’s behind arbitrary proxies or HTTP authentications. That is, the app won’t know immediately if a URL needs authentication and will repond to an authentication request by asking the user for credentials, the same way it does for the Android Browser.

I recently worked out how to request user authentication for a WebView, responding to authentication requests from the browser, bringing up a dialog, and advancing the user to the destination page. I am looking to do the same with HttpClient.

The basic process, as I see it, is to:

  1. Perform the request via HttpClient.execute.
    • If not 401 or 407 with proper headers, trigger a “done” callback.
    • Otherwise…
  2. Pop up a dialog asking for the username and password.
  3. Set the http credentials in the HTTP client via HttpClient.getCredentialsProvider().setCredentials.
  4. Return to step 1 until the the user clicks cancel or the server gives up. In that case, trigger a “failed” callback with the last response received.

Am I on the right track or has someone already implemented something similar? I would hate to be reinventing the wheel on this.

  • 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-08T17:13:18+00:00Added an answer on June 8, 2026 at 5:13 pm

    The reactive approach described above did work. Responding to an arbitrary 401 or 407 request is effective with the caveat that you need to suppor each authentication scheme you expect to encounter so something like UsernamePasswordCredentials won’t work for NTLM.

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

Sidebar

Related Questions

I am trying to create an android app that has the following: Theme set
Im trying to create my own url scheme so my android app can get
I am trying to get an image from URL in Android and set it
I am trying to make an android app and I can't seem to find
I'm trying to create an Android app that adds a random quote to images.
I am trying to create a simple 3-D app for android that will have
I'm trying to do http live streaming from VLC to an android app using
I'm trying to build an android app that allows user to play a game
I am trying to writing code so that my android application can query a
I am trying to make an android app that retrieves info from google app

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.