Building a Simple In-App Browser Android Source code

Android’s WebView allows you to integrate a webpage as a part of the app. WebView comes with all the features that of a desktop browser like managing history, cookies, HTML5 support and lot more. Using webview you can build very cool apps like integrating HTML5 games in the app.

andriod-webview-in-app-browser

In this article we are going to learn the basic usage of WebView starting from displaying a webpage to building a simple in-app browser that provides navigation and bookmark support. You will also learn how to use the WebView with other material elements like CollapsingToolbar and NestedScrollView to achieve the native android experience.

The Basic Usage

Integrating a WebView in your app won’t take more than two steps. First you need to include the WebView element in your xml layout.

<WebView

android:id="@+id/webView"

android:layout_width="match_parent"

android:layout_height="wrap_content"/>

Second you have load the specific url in webview from your activity. The below loads google’s homepage into web view.

WebView webView = (WebView) findViewById(R.id.webView);

webView.loadUrl("http://google.com");“http://download.androidhive.info/apk/webview.apk

Download Link

If download link not work plz open in browser

Leave a Reply

Your email address will not be published. Required fields are marked *