Rock YouTube channel with real views, likes and subscribers
Get Free YouTube Subscribers, Views and Likes

How To Create WebView App In Android Studio

Follow
Ghost Together

Sign Up https://semicolon.dev/YouTube
(We're free online community, meet other makers!)

#androidstudio #webview #apk #mobiledevelopment

In this tutorial we'll go over the steps taken to create a WebView wrapper app for Google Play Store in Android Studio. We will create and generate an APK file!

Android tutorial transcribing this Generate APK / ABB video instructions:
https://semicolon.dev/androidstudio/...

Keywords:
android studio webview example
android studio how to build apk
android studio how to run emulator

Source code to copy and paste:

android:id="@+id/webview"

import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

Source Code from 04:03 (Replace example.com with own URL)
===================================================

mywebView=(WebView) findViewById(R.id.webview);
mywebView.setWebViewClient(new WebViewClient());
mywebView.loadUrl("https://www.example.com/");
WebSettings webSettings=mywebView.getSettings();
webSettings.setJavaScriptEnabled(true);

Source Code 2 from 04:30
=====================

public class mywebClient extends WebViewClient {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view,url,favicon);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}
@Override
public void onBackPressed() {
if (mywebView.canGoBack()) {
mywebView.goBack();
} else {
super.onBackPressed();
}
}

00:00 How to create an Android WebView app for publishing on Google Play online web store
00:54 Modifying MainActivity.java class file (add usespermission android name android.permission.INTERNET property)
01:37 Replacing TextView with WebView
01:43 Changing ConstraintLayout to RelativeLayout
02:00 How to find WebView component and add it to main android app view
03:20 Where and how to import Android webkit WebSettings, WebView and WebViewClient classes / objects into your Android app.
04:03 Enter example WebView code into your MainActivity.java file
04:30 Enter second sample WebView code into MainActivity.java file
05:00 How to build and generate APK file in Android Studio
06:31 How to launch your WebView APK file in Android Studio device emulator

More info from article
==================

In order to publish your WebView app in Google Play store, you need to buid APK and AAB
/ apk, aab, webview, app, pwa, android, studio, build, file
Making a WebView App has it's pros and cons. You might not get 100% native features by converting your PWA into a WebView App. But it can get pretty close

One advantage of using a WebView wrapper around your website URL (which should be built as PWA) is you can publish it in Google play store, without having to code it in native development environment.

This tutorial is a transcript of a tutorial video by Javascriptual, you can watch it below.

How to build APK file in Android Studio (complete step by step instructions)

In this tutorial I'm going to show you how to build your own Android WebView app using Android Studio for publishing your app in Google Play store.

Let's go ahead and open a new project in Android Studio and select Empty Activity project, click Next button and create a name for your application.

In this drop down and change Kotlin to Java: go ahead and click Finish button and it's going to take a while to install.

Now that the installation is completed, click on the finish button. If the Windows Firewall box shows up just click Allow Access.

Make sure the word INTERNET is in uppercase letters and close the bracket.

Now in the upper left corner of Android Studio editor, select the 'activity_main.xml' file, and you're going to open the following view:

Go ahead and remove the TextView component completely . Select and delete that and then you want to rename this component entirely. So delete everything but layout and rename it to RelativeLayout. Make sure relative layout is also specified on top in the opening bracket.

Now in the upper right corner, go to design, now here click on the magnifying glass button and that will open up a new search input box. So in this search start typing the word 'web' because we're going to look for the WebView component. Now click and drag the WebView component into this box here.

posted by cinemanetdt