If you want to convert your website into a webview in android studio. Here is the source code of the complete android webview. You just need to download the source code and open in the android studio. 

Complete Webview in android studio steps

First open android studio and open save source code package. Wait a few minutes. It will take several minutes to load the file and download some essential files.

After source code is completely loaded. Go to app>src>main>java>online>example>app>my webview client java file. In this find you will find this line number 15.

“if ((String.valueOf(request.getUrl())).contains(“your website”))”. Replace “your website” with your website url address. 

Then again go to app>src>main>java>online>example>app>Main activity java file you need to search this line number 196 and 202. 

“mWebView.loadUrl(“your website”);” just replace your website with your website url in both 196 and 202 line numbers.

After this setup your url is ready for android webview application.

Splash screen setup in android webview

For this setup you just need a logo of your website to show an image  of your website when an android webview application opens.

Go to app>src> main>res>layout>activity_splash.xml. In this file, insert a logo in a drawable folder and insert the name of the logo in code.

In line number 15 you will find this code android:src=”@drawable/web_2″ you will just replace web_2 with your logo name. You can control the time delay of the splash screen when the android webview opens. Go to app>src>main>java>online>example>app>splashActivity.java file. In line number 27, you can increase time delay of the splash screen. By default it is set to 3 second.

Another change in style.xml. Go to app>src> main>res>res>value>style.xml. In line 11

<item name=”android:windowBackground”>@drawable/web_2</item> replace web_2 with your logo name.

Now your splash screen is ready.

No internet setting in android webview

This code will help you to notify if the internet connection is enabled or not. Create a logo of no internet and paste it on a drawable folder. Go to app>src> main>res>layout>activity_main.xml.

In line number 24 you will find this code “android:src=”@drawable/no_internet”. Replace no_internet name with your no internet logo name. 

Now your No internet setting is complete.

Changing app name in android webview

If you want to change the app name of your android webview, Go to  app>src> main>res>res>value>string.xml. In code line 2 <string name=”app_name”>App name</string>. You just need to replace the app name with your application name.

Android logo for webview

On the left side, right click on the app folder, then click on new and go to the image vector. When the popup window opens click on the folder and choose your app logo and shape for your logo and click on next and finished. 


Now your website has been converted into a webview in android studio. Debug your mobile with android studio and click run. Your app is ready for webview in android studio. 

Download webview source code 

Similar Posts by The Author: