Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically download an HTML page in Android and get its HTML?

I need to download an HTML page programmatically and then get its HTML. I am mainly concerned with the downloading of the page. If I download the page, where will I put it?

Will I have to keep in an String variable? If yes then how?

like image 432
Fahad Avatar asked Dec 25 '10 17:12

Fahad


People also ask

How can I get HTML code in Android?

Android phone or tablet using ChromeOpen the Google Chrome browser on your Android phone or tablet. Open the web page whose source code you want to view. Tap once in the address bar and move the cursor to the front of the URL. Type view-source: and tap Enter or Go.

How can I download current page in HTML?

You can also right-click anywhere on the page and select Save as or use the keyboard shortcut Ctrl + S in Windows or Command + S in macOS. Chrome can save the complete web page, including text and media assets, or just the HTML text.

Where do I put HTML files on Android?

1: To add a local HTML file into your Android project there must be an asset folder in it. To create an asset folder in Android studio open your project in Android mode first as shown in the below image. 2: Go to the app > right-click > New > Folder > Asset Folder and create the asset folder.


1 Answers

This site provides a good explanation on how to download a file, and also how to set the location to where it should be stored. You do not have to, and should not, keep it in a string variable. If you are to manipulate the data I would suggest you use an XML parser.

like image 99
hanspeide Avatar answered Nov 14 '22 21:11

hanspeide