SubscribeSubscribe with Androidlift to get new post on mail.

how to load html file in android webview

Android Load HTML


Android load html.A View that displays web pages. This class is the basis upon which you can roll your own web browser or simply display some online content within your Activity. It uses the WebKit rendering engine to display web pages and includes methods to navigate forward and backward through a history, zoom in and out, perform text searches and more.

Note that, in order for your Activity to access the Internet and load web pages in a WebView, you must add the INTERNET permissions to your Android Manifest file:

 

  • first, embed an html file in the app resources. For this, create the “assets” subfolder in “module” and add your HTML formatted file:
android load html
html in asset

To create assets folder in Android Studio –

Right click on -> app ->new -> folder -> Assets folder

and put your html file inside it that sit.

android load html
Create assets folder in Android Studio.
  • use a WebView view in your layout file:
  • For URI link use
  • For URL Link use
Activity AboutUs :

XML activity_about_us
AndroidManifest.xml file
webview.html file

android load html output :


android load html
Output of URI i.e Html file from assets folder
android load html
Output from url link

(286)

  • raj

    very usefull.. thnq…sir