How to convert website into android app in android studio-step by step

Welcome to the next android development tutorial

In this Android tutorial, we will make an app which will demonstrate how to convert a website into an android app in the Android studio. This app will simply load a URL of any website. But make sure that the website which you want to convert into the app should be responsive. We will use in our app.

Useful links

Steps to convert website into android app

  • Select AndroidManifest.xml

In this file, we will add internet permissions. So add the following line of code

 <uses-permission android:name="android.permission.INTERNET"></uses-permission>
  • Select main_activity.xm

In this file, we need only webview widgets. Drag and drop webview or add code manually. You can adjust height and width.

    android:layout_alignParentEnd="true" />
  • Select file

In this file we Firstly we will create an instance of webview and bind it to id of this webview which we have given in xml file. Now we need some web settings. So we will create an instance of WebSettings and add this code  WebSettings webSettings = myWebView.getSettings(); .Now we need to set javascript to true. So we will add this code  webSettings.setJavaScriptEnabled(true); . Now to load the url we will use method loadurl(); and pass the url of your website. Now when our website will be loaded, we need to set some settings for events or clicks on website links. For that we will add setWebViewClient(new WebViewClient()); . We can make new java class to modify the click events. Now one important thing is that when our website is loaded in android app and if we click on links in website, no doubt next page will be loaded but we can not go on a back page by pressing back button. We have to write some code for that. We can use onBackPressed() method to handle the back clicks. We will check if we can go back or not. So read following code carefully. 

private WebView myWebView;


    protected void onCreate(Bundle savedInstanceState) {



        myWebView = (WebView)findViewById(;

        WebSettings webSettings = myWebView.getSettings();



        myWebView.setWebViewClient(new WebViewClient());




    public void onBackPressed() {

        if(myWebView.canGoBack()) {


        } else {




This is all about Now you can test your app. It should load Google’s homepage.


I hope now you understand how to convert a website into an android app. This is very basic app. You can do a lot more things with the app. For example, you can add processing bar, a sharing button, a menu etc. For any query, you can ask in the comment section. I will recommend you to read my more tutorials on Android development.


Leave a Reply

Your email address will not be published. Required fields are marked *

five + fourteen =