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

  • Home
  • SEARCH
  • 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 6834809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:09:26+00:00 2026-05-26T23:09:26+00:00

I have an android application in which I need to get the HTML code

  • 0

I have an android application in which I need to get the HTML code of the page that will be loaded in the webview. This code I need to get it even before the page loads in the webview and act accordingly.

I am trying to capture the URL that would be loaded in the method

“public void onPageStarted(WebView view, String url, Bitmap favicon)”

But what is the way to get the HTML code of the page that would be loaded in the webview?

  • 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-05-26T23:09:26+00:00Added an answer on May 26, 2026 at 11:09 pm

    I don’t know for how to get webview content, but I am using this for code of webpage

    HttpClient httpClient = new DefaultHttpClient();
    HttpContext localContext = new BasicHttpContext();
    HttpGet httpGet = new HttpGet("website url");
    HttpResponse response = httpClient.execute(httpGet, localContext);
    String result = "";
    
    BufferedReader reader = new BufferedReader(
        new InputStreamReader(
          response.getEntity().getContent()
        )
      );
    
    String line = null;
    while ((line = reader.readLine()) != null){
      result += line + "\n";
    
    }
    

    The second method is,

     URL url;
        try {
            // url = new URL(data.getScheme(), data.getHost(), data.getPath());
            url = new URL("website url");
            BufferedReader rd = new BufferedReader(new InputStreamReader(
                    url.openStream()));
            String line = "";
            while ((line = rd.readLine()) != null) {
                text.append(line);
            }
    
        } catch (Exception e) {
            e.printStackTrace();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Web Service and an Android application that uses this web service.
I have been given the tasks of speccing a mobile application, which will need
I have a android application which needs username and password to login. I need
I have an Android/HTML hybrid application that has a small number of nested ViewFlippers
I have to an android application in which I need to convert the current
I have application using Android 2.1 which utilize LocationManager to get the altitude. But
I have an Android application which needs username and password to login. I need
I have an Android application that connects to Facebook to request authorization of an
I want to integrate the zxing source code to my Android application. I have
I need an Android application which should be able to fetch data from the

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.