How To Create WebView App In Android Studio

  Рет қаралды 64,702

Ghost Together

Ghost Together

Күн бұрын

Sign Up 👻👻👉 semicolon.dev/KZfaq
(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:
semicolon.dev/android-studio/...
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("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 uses-permission 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.

Пікірлер: 101
@4iz_com
@4iz_com Жыл бұрын
It's rare for me to comment on any KZfaq clip, but the material you posted on your channel is more than great, I'm happy and proud that I learned how to make the app without any mistakes, thank you from the bottom of my heart ❤
@technontiv
@technontiv 6 күн бұрын
Hello! I have also designed a website in WordPress and I want to convert it into an android application to upload it to the playstore, I wanted to ask you, if I need to convert my page into a progressive web app or can I upload my website as it is ,to the playstore ( just with the steps from the video)? thanks!
@hdyssincorporation989
@hdyssincorporation989 Жыл бұрын
Well I have no words. Just EXCELLENT!!! You resolved one of my major problems and thank you for that.🥳
@jeffreyriggs1911
@jeffreyriggs1911 10 ай бұрын
Finally, a tutorial that actually works!!!!! thank you very much.
@gabrielantal
@gabrielantal Жыл бұрын
First of all a BIG THANK YOU. Anyone willing to learn -- in about 8 minutes! -- how to create an Android App which will simply open a web site/page, need to look no further because this video is spot on. And I'm saying this after I checked out at least a dozen other resources (with the very same topic) available online. Keep it up Ghost Toghether!
@ghosttogether
@ghosttogether Жыл бұрын
That's why I make them.
@abhigosavi
@abhigosavi Жыл бұрын
I am WordPress developer. I was searching for Webview App. After watching this video, I have created App in few minutes. You have explained very easy in video. I just followed the steps and I created app....Thanks a lot.
@technontiv
@technontiv 6 күн бұрын
Hello! I have also designed a website in WordPress and I want to convert it into an android application to upload it to the playstore, I wanted to ask you, if I need to convert my page into a progressive web app or can I upload my website as it is ,to the playstore ( just with the steps from the video)? thanks!
@russelnormandia2876
@russelnormandia2876 9 ай бұрын
Great tutorial. Clear and concise.
@shoden
@shoden Жыл бұрын
Thanks for the great and simply explained video.
@SaadHamid
@SaadHamid 2 ай бұрын
This was super helpful and it works!!!! Thank you sir
@AnkitKumarRavi9
@AnkitKumarRavi9 3 ай бұрын
Thank you so much 🇮🇳 sir wonderful fantastic content ❤ I'm beginners I'm not knowledge coding but now try to make a app
@varghesepaul9540
@varghesepaul9540 Жыл бұрын
Thanks for sharing you knowledge.
@ghosttogether
@ghosttogether Жыл бұрын
If this helped you, please Like and Comment 🙂 This helps more people find my videos on KZfaq, and motivate me to make more videos for ya'll
@butchcadungog
@butchcadungog Жыл бұрын
Can I ask if the website is monetized, what happened to the ads it also shows in the app too? 😇I hope you can respond to this query of mine. Thanks a lot!
@ljunggrenerik
@ljunggrenerik Жыл бұрын
It helped a lot, The only tutorial I found which helped me create a functinal WebView app. However, I have a problem. If the app is force closed it won´t start properly again and has to be reinstalled in order to work properly again. Any ideas on what I did wrong or other suggestions for fixing this? Thank!
@ljunggrenerik
@ljunggrenerik Жыл бұрын
Or rather, I tried to convert this tutorial to an Android TV app using the information on the official Android development page. It works fine once, but then after force close or device restart it wont open again.. Any ideas?
@syedmuhammadali628
@syedmuhammadali628 4 ай бұрын
This is an appreciation message for this the creator of this video. I've been wandering aimlessly on the Internet, from Android Studio Developers Website, to ChatGPT, to Bing to KZfaq, but I couldn't find a simpler And to the point video than this. So anyone with no knowledge of app development, looking to make a simple app which can show his website should follow this Tutorial. A huge Thank you to the Video Creator. Keep up the good work.
@ghosttogether
@ghosttogether 4 ай бұрын
Thank you kind sir 🙂
@syedmuhammadali628
@syedmuhammadali628 4 ай бұрын
@@ghosttogether I'm really impressed by your calming voice and the way you provided all the code. That prevents any error while writing code by newbies.
@gerhardwillemse5246
@gerhardwillemse5246 Жыл бұрын
Thanks, excellent tutorial
@peti2ty
@peti2ty Жыл бұрын
Thanks, working! :)
@tunein919
@tunein919 3 ай бұрын
You are great man. getting everything right in just first attempt 🔥🔥🔥🔥
@ghosttogether
@ghosttogether 3 ай бұрын
thank you glad it helped
@pick_pick_pick
@pick_pick_pick 15 күн бұрын
Thanks for teaching us 🥰
@conteudoanimal
@conteudoanimal Ай бұрын
thanks a lot Ghost Together ... worked fine as shown .. congrats for the video ... sucess to you my next step is publish this apk to google play ... I did this last time in 2019 and it changed a lot kkk thanks a lot again !!!!
@Worldjam01
@Worldjam01 Жыл бұрын
Best tutorial ever! Thanks for share!
@ghosttogether
@ghosttogether Жыл бұрын
Glad it helped get started 😃
@NileshPanchal-nx4pw
@NileshPanchal-nx4pw 10 ай бұрын
Smart and Awesome..
@OluwamayowaSteepe
@OluwamayowaSteepe 4 ай бұрын
Very well done!
@AnkitKumarRavi9
@AnkitKumarRavi9 3 ай бұрын
Today's app created thank you sir
@pexigno
@pexigno Жыл бұрын
Really helpful thank you very much! One quick question: how can I enable cache in Web view? For example, using html5 games saves progress...
@istotka
@istotka Жыл бұрын
Hi. Please show how to add a menu and how to hide the items visible in the web version in the app
@ArloFE
@ArloFE 3 ай бұрын
Thankyou very much
@vjincharadze
@vjincharadze Жыл бұрын
Thank you so much
@RKMsVines
@RKMsVines Жыл бұрын
Thanks a Lot
@anythingonline1
@anythingonline1 Жыл бұрын
Thanks for this vid 💯🤲🏽
@ghosttogether
@ghosttogether Жыл бұрын
Welcome :) I also recommend learning React Native or Flutter. WebView is very limited as far as building fluid UX. Good luck!
@YuriS-jx5iy
@YuriS-jx5iy Жыл бұрын
Thanks!
@gamepro-pv8to
@gamepro-pv8to Жыл бұрын
Thanks 🤩
@nevermind_sabix
@nevermind_sabix 4 ай бұрын
How can I open other URL externally. Not in my build app. Great Tutorial by the way ❤
@OluwamayowaSteepe
@OluwamayowaSteepe 4 ай бұрын
Well done again. I have a few questions. 1. How do you enable file upload/camera in the webview app? 2. How would you enable the app to use the fingerprint sensor of the device? 3. I noticed that the logo isn't showing when simulated on both virtual and physical devices. How does one change that? 4. At the very top of the app, I noticed it has a somewhat purple background, how can that be changed?
@anthonyagadaga3014
@anthonyagadaga3014 Жыл бұрын
So I made a web app with Android Studio for bills payment that requires sign-up and login and I discovered that the login button is not working as expected though it is working fine using browsers. The create account button is working fine on the web app as expected. I need help
@georgebeard3319
@georgebeard3319 8 ай бұрын
BTw the formatting of the text under the description is all wrong, somehow missing capital letters that are shown in the video
@mr.parthiv0404
@mr.parthiv0404 7 ай бұрын
Thank You Brother
@bensara6280
@bensara6280 11 ай бұрын
After doing all this I have written website address also but it shows white screen and nothing. Can you tell me what did i do?
@harishsamsit
@harishsamsit Жыл бұрын
thanks for an excellent video.....and i need a help....i'm working on a webview app. normally when my website opens, its reload by collecting location info...i dont know how to achieve this in android webview..can you help me with this?
@timothyagyekum9944
@timothyagyekum9944 Жыл бұрын
pls any help. with your video i was able to convert by e-book website into an app. But my client cant download the materials contain in the e-book after the make payment. thank u
@cherryher0
@cherryher0 Жыл бұрын
nice video
@patrickfernandes3026
@patrickfernandes3026 Жыл бұрын
Hi sir my wordpress site have footer navbar and does not open up when i convert my site to andriod app it show error i have follow all your steps please help me
@AFuller2020
@AFuller2020 Жыл бұрын
Hello, I have "error: illegal start of type webSettings.setJavaScriptEnabled(true);" Any ideas?
@johnprg1209
@johnprg1209 8 ай бұрын
If my website use a database ….. In my app it will be used normally and parse the data in database ?
@lahcsinayrahca
@lahcsinayrahca 6 ай бұрын
Wow that's great... I want same thing on kotlin..
@user-hf7mz3tl8c
@user-hf7mz3tl8c 2 ай бұрын
Thank you so much sir
@ghosttogether
@ghosttogether 2 ай бұрын
Welcome apk :)
@user-gv1wv1bx2d
@user-gv1wv1bx2d 4 ай бұрын
thanks
@techlearning3468
@techlearning3468 11 ай бұрын
this is support video fullscreen ?
@praveenofficial2871
@praveenofficial2871 6 ай бұрын
It only opens 1 webpage and shows black page when clicking on sublinks buttons.
@harryhansen9039
@harryhansen9039 10 ай бұрын
can i know is this work in all version of android studio
@user-cg5xg7im5f
@user-cg5xg7im5f 6 ай бұрын
Where you use mywebClient class?
@Ivugangingo
@Ivugangingo Жыл бұрын
How about Splash Screen and Icons
@netgensey3209
@netgensey3209 Жыл бұрын
HOw to you add your ICON to your code??
@user-ru1pi4cg1i
@user-ru1pi4cg1i 2 ай бұрын
Hello. I have a question, maybe someone know. I’m need to put webview in homepage widget. How I know, this is impossible. Do you know any bypass solution how I can do it?
@spectrecular9721
@spectrecular9721 Жыл бұрын
I think there's an error in the code... > mywebView.setWebViewClient(new WebViewClient()); should be: > mywebView.setWebViewClient(new myWebClient()); Or you can simply delete the myWebClient class entirely, no?
@thinkbig5083
@thinkbig5083 Жыл бұрын
And same public class myWebClient extends WebViewClient {
@salvamipc
@salvamipc 5 ай бұрын
Hi, it works great, but non of the tel, mail,.. link work, they generate an err_unknown_url_scheme error. Can you help please
@marcosalbertozuluagavargas9842
@marcosalbertozuluagavargas9842 Жыл бұрын
shouldOverrideUrlLoading deprecated :(
@maxbouz
@maxbouz Жыл бұрын
This is great! Thank you! You really help
@ghosttogether
@ghosttogether Жыл бұрын
Welcome :)
@bhumiputra6108
@bhumiputra6108 6 ай бұрын
Thanks
@YaserRiaz
@YaserRiaz 7 ай бұрын
Hi, can you anyone help, I am getting 15 Errors : "15 issues were found when checking AAR metadata:"
@Basshase1
@Basshase1 7 күн бұрын
hi can you remake this for the last Android Studio koala version ? cause they rebuild some things an i cant find it ! Thx
@nothumanyt6918
@nothumanyt6918 4 ай бұрын
Can you please reply me? I have a website which has stripe payment gateway. If I make a web view app for the website and upload it on play store, will they reject it for stripe? As it is a third party payment gateway.
@andreibalanco
@andreibalanco 6 ай бұрын
How to resolve the problem with err::ERR_NAME_NOT_RESOLVED
@TruthMadeHuman
@TruthMadeHuman Жыл бұрын
Only thing it does is open up a blank page for me.
@syedmuhammadali628
@syedmuhammadali628 4 ай бұрын
Hi. Can you please tell me which Android studio version you are using? The latest Android Studio Version only lets you make apps in Kotlin. Please reply, Your help will be really appreciated.
@ghosttogether
@ghosttogether 4 ай бұрын
If you submit a Super Thanks I can provide guidance.
@syedmuhammadali628
@syedmuhammadali628 4 ай бұрын
@@ghosttogether Yes sure. I succeeded in making a WebView app. I'm going to give an appreciation message right now.
@TeensAnimation
@TeensAnimation 5 ай бұрын
How To implement unity ads
@DestructiveBurn
@DestructiveBurn 11 ай бұрын
They changed up the program. There is no Language just Minimum SDK
@developeroffounderitltd8488
@developeroffounderitltd8488 9 ай бұрын
Anybody faces that problem I got a error. "An issue was found when checking AAR metadata: 1. Dependency 'androidx.activity:activity:1.8.0' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Recommended action: Update this project to use a newer compileSdk of at least 34, for example 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). " that was the error anybody know the solutions ?
@dianamunene6645
@dianamunene6645 9 ай бұрын
am facing the exact same issue did you get a solution?
@developeroffounderitltd8488
@developeroffounderitltd8488 9 ай бұрын
@@dianamunene6645 Yes go to the file Name build.gradle {module} and change the line number : 7 maybe compileSdk Its should be Minimum 34 now try Its worked for me
@supriya2013
@supriya2013 Жыл бұрын
How to add video splash screen into this web apps.
@ghosttogether
@ghosttogether Жыл бұрын
That I don't know lol
@AnkitKumarRavi9
@AnkitKumarRavi9 3 ай бұрын
No error found only 1st attempt app created 😊
@user-kw8oe9ez5t
@user-kw8oe9ez5t 4 ай бұрын
like and share and subscribe brothers you wont find content like this its someones life s work
@andrealonghin7525
@andrealonghin7525 Жыл бұрын
is impossible to connect to http site, only for https!! Where is one way?
@banjangkim5242
@banjangkim5242 Жыл бұрын
1. make a file [ res -> xml -> network_security_config.xml ] then write this domain_togo 2. and add lines in [ AndroidManifest.xml ] file [manifest -> application] properties android:networkSecurityConfig="@xml/network_security_config" android:usesCleartextTraffic="true" that's it.
@agudecar
@agudecar Жыл бұрын
I cannot make this work, gives me errors.
@LoganJonesJ
@LoganJonesJ Жыл бұрын
Same. I keep getting some seemingly small errors. Every tutorial I've tried gives me like 4 errors and they're never even the same.
@crazyquinn1973
@crazyquinn1973 Жыл бұрын
you are the boss! Thank youuuuu!!!!
@ghosttogether
@ghosttogether Жыл бұрын
did it work?
@crazyquinn1973
@crazyquinn1973 Жыл бұрын
@@ghosttogether totally
@Vsev0001vsev
@Vsev0001vsev 4 ай бұрын
it doesn't work, there are only errors, maybe it's the version
@thanasisathanasi4965
@thanasisathanasi4965 9 ай бұрын
Why Java???? Wasted video !
@xpectromo
@xpectromo Жыл бұрын
First of all, THANK YOU!! How can I remove the upper black bar with the name of the apk?
@drenwww
@drenwww Жыл бұрын
Hi Guys, hi @GhostTogether, my web view doesn't display on the entire screen but instead create white line on both sides, any fix? Thanks for the vid!
@KJPiGames
@KJPiGames 4 ай бұрын
Webpage not available ERR_CLEARTEXT_NOT_PERMITTED
20 POWERFUL Apps that are NOT on the Play Store!
15:01
HowToMen
Рет қаралды 478 М.
UNO!
00:18
БРУНО
Рет қаралды 3,3 МЛН
Box jumping challenge, who stepped on the trap? #FunnyFamily #PartyGames
00:31
Family Games Media
Рет қаралды 19 МЛН
EVOLUTION OF ICE CREAM 😱 #shorts
00:11
Savage Vlogs
Рет қаралды 12 МЛН
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 7 МЛН
Are Linux Smartphones about to KILL Android?
11:19
Mrwhosetheboss
Рет қаралды 8 МЛН
15 UNDERRATED Apps that are NOT on the Play Store!
11:44
HowToMen
Рет қаралды 1,1 МЛН
5 Simple No-Code SAAS Ideas You Can Launch In 2024
12:49
WeAreNoCode
Рет қаралды 181 М.
How I Coded An Entire Website Using ChatGPT
18:22
Nick White
Рет қаралды 1,9 МЛН
How ChatGPT Built My App in Minutes 🤯
8:28
Website Learners
Рет қаралды 2,2 МЛН
React Native vs Flutter in 2024 - Make the RIGHT Choice (Difference Explained)
10:31
Daniel Dan | Tech & Data
Рет қаралды 160 М.
Build Your Own Android Webview App: A Step-by-step Guide With Android Studio
16:35
Load Local HTML Files Into WebView | Android Studio Tutorial
8:11
Sandip Bhattacharya
Рет қаралды 22 М.
UNO!
00:18
БРУНО
Рет қаралды 3,3 МЛН