Quickly create a ‘Website Viewer’ Android App using WebChromeClient.

(by AXDS)

Follow the bold words to speed up the tutorial šŸ™‚

Create a new Android Studio Project. For this simple application a blank template will be a good choice.

Once it has all loaded replace the contents of the ‘mainActivity.xml’Ā file with:

<!--?xml version="1.0" encoding="utf-8"?--> <webview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent"></webview>

Add to the ‘AndroidManifest.xml’:

<uses-permission android:name="android.permission.INTERNET"> </uses-permission>

Replace nearly allĀ the contents, don’t removeĀ your package declaration ofĀ ‘mainActivity.java’ with:

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class WebPageLoader extends Activity
    final Activity activity = this;

    public void onCreate(Bundle savedInstanceState)
        WebView webView = (WebView) findViewById(R.id.webview);

        webView.setWebChromeClient(new WebChromeClient() {
            public void onProgressChanged(WebView view, int progress)
                activity.setProgress(progress * 100);

                if(progress == 100)

        webView.setWebViewClient(new WebViewClient() {
            public boolean shouldOverrideUrlLoading(WebView view, String url)
                return true;


Connect your phone and run the application!

Operating System/Browser Emulator

(by AXDS)

This website is subscription plan based, but offers a free 30 minute trial. GreatĀ for testing a live site on combinations of operating systems and browsers.

The mainĀ combinations I’ve noted from theĀ free trial:

  • 7.1 Safari on Mavaricks
  • IE 11 on Windows 10

Link:Ā https://www.browserstack.com/