How to create a WebView app in android studio

2 min


How to create a WebView app in android studio (Source) | irmone.com
How to create a WebView app in android studio (Source) | irmone.com
0
(0)

Hi. Today I’m going show you How to create a WebView app in android studio. I show you how to or which codes you have place on android studio and where.

sindulanthaya mp3 download banner

Step 1

  • Create a new project in Android Studio, Add your project name and other details and also select Empty template for create the app.

Now you can find java files or pages on your Android Studio.

Step 2

  • First go to layout/activity_main.xml and add the following code bellow the layout and before the < / > tag.
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent">
</WebView>

Step 3

  • Now go to MainActivity.java and add following code
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends AppCompatActivity {
private WebView webView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView webView = (WebView)findViewById(R.id.webView);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("https://www.tophubz.com");
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
}
public void onBackPressed(){
if (webView.canGoBack()){
webView.goBack();
} else {
super.onBackPressed();
}
}
}

Step 4

  • Now you have to add internet permission code in androidManifest.xml for work your app on Internet.
<uses-permission android:name="android.permission.INTERNET"></uses-permission>

Now all done. Now run your android application with your android emulator. ( Click Run ) This is simple way. And next lessons I will show you how to improve your WebView app for super performance and how to add another features for your app.

irmone.com | Have you tried irmone these services also…

Welcome to irmone. irmone.com is a global, multi-platform media and entertainment company. Using irmone you can find anything you want.

irmone.com – Teamwork Makes The Dream Work

SportsGamesEntertainmentBollywoodHot NewsPhotographyStoriesTechEventsTravelEsportsVideosMoviesMusicReviewsQA, and others are the main categories in irmone.com.

Coming together is a beginning, Staying together is progress, and working together is success!!

And also here are some tags of irmone.com.

TrendingHotPopularCricketFootballTennisBasketballRacingSoccerOtherFMXFormularMotoGPHot GalleriesGalleryYT TrendingMovie ReviewsTechnology, and more than more you can find by searching irmone.

We invite all worldwide internet lovers to stay with us and get the latest updates for everything you want. irmone.com always with you. We always try to make our world a better place for people.+

Tags:

how to create a webview app, android studio webview app, tranlate my website to mobile app, how to create an android app

How was this? Add your rate

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.


Like it? Share with your friends!