How to create an android app from website using android studio in 2019 – Part 1

It’s very easy to create an android app from the currently working website in android studio.

Requirements for converting website to android app:-

  1. Android Studio
  2. Running website

We can do that in few steps:-

1. Start new project in Android Studio

and fill necessary fields as given below.

  • Fill the name of the app project and click on button “Next”.

  • Then select the mobile version for what you want to create the .apk file.

  • Select “Empty activity” from activity section and then click on “Next” button.

  • Now click on button “Finish”.

 Now your coding screen will open as in image and you’ll need to make few changes.

2. Open activity_main.xml page and do following changes.

  • Open the page in text mode by clicking on text button from bottom left.
  • Add this line in tag <>
  • Remove the “TextView” section as we will use “WebView” mode.
  • Add following code as “WebView” section.
    Now your activity_main.xml file will be :-
<?xml version="1.0" encoding="utf-8"?>< xmlns:android=""    xmlns:app=""    xmlns:tools=""    android:layout_width="match_parent"    android:layout_height="match_parent"    tools:context=".MainActivity"    tools:layout_editor_absoluteY="81dp">

    <WebView        android:id="@+id/webview"        android:layout_width="match_parent"        android:layout_height="match_parent"        tools:layout_editor_absoluteX="0dp"        tools:layout_editor_absoluteY="0dp" />


3. Replace content of with following.

Also you ll need to change the url with your website’s url here.


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

public class MainActivity extends AppCompatActivity {
    private WebView mywebView;

    @Override    protected void onCreate(Bundle savedInstanceState) {
        mywebView.setWebViewClient(new WebViewClient());
        WebSettings webSettings=mywebView.getSettings();

    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){
            return true;

    @Override    public void onBackPressed(){
        else            super.onBackPressed();


4. Replace the content of AndroidManifets.xml file with following.

<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android=""    package="">
    <uses-permission android:name="android.permission.INTERNET"></uses-permission>

    <application        android:allowBackup="true"        android:icon="@mipmap/ic_launcher"        android:label="@string/app_name"        android:roundIcon="@mipmap/ic_launcher_round"        android:supportsRtl="true"        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />


5. Now click on the Run button on top menu and select the simulator or mobile attached to computer for running (testing) the website.

6. Now you will see the app running successfully in the simulator or mobile.

In next tutorials we’ll learn to Add splash Screen for app and also How to add the app in the play store.