website to app

How to make a website into an app?

Do you own a website? If so, you can turn your website into an app and download it to the google play store. No need to worry about payments because it is absolutely free. This will help your readers to visit your website directly on their mobile phones. Not only will it increase your traffic but also your loyal subscribers. With that being said, let’s start.

How to make a website to an app?

  1. First thing is to download the Android Studio by clicking this link.
  2. After downloading, open it and click ” Create New Project”.
  3. Select “Empty Activity”.

4.Click Next. Enter your Application Name, Package Name, the location where you want it to be saved, choose Java as the language, and the minimum SDK as API 16: Android 4.1 Jelly Bean (your app will run on approximately 99.8% devices. Then click “Finish”.

5. Go to App- manifest- Android manifest.xml. Below the package name, press enter and Copy this code:

<uses-permission android:name=”android.permission.INTERNET”></uses-permission>

6. Go to activity_main.xml. Remove the code from text view until parent.

Delete the highlighted with blue code.

7. Replace the code </androids.constraintlayout.widget.ConstraintLayout> to Relativelayout as shown in the photo.

8. Click “Design” located on the top right portion. Click the search icon and type Web. Drag the webview to the sample design.

9. Go to Code and Copy and Paste this code below the webview: android:id=”@+id/webview”

10. Go to res located on the left side, click values then styles.xml. Change the Dark Action Bar into NoActionBar.

11. Go to “MainActivity.java”, Click the 3 dots in import, Click enter underneath bundle and copy and paste this code:

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

12. Copy and paste this under the appcompat activity:

private WebView mywebView;

13. Under the setContentView(R.Layout.activity_main), copy and paste this code:

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

14. Copy and paste this code below the first }.

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();
            }
}

If there are codes in red, it means there are error. to fix it, just press Alt+Enter.

Thats it! After that Click on Build, generate signed bundle, seleck APK, click Next.

If its your first time to make an app, Select the create new located below the key store path.

For the Key Store Path, Save it on your PC by clicking the folder icon located beside it. Either in Local C,D or E, its up to you. Create a File name of that folder then click OK.

Enter the password, and confirm it by entering the same password. Input your Alias and again the password. Select the Validity as you like. Enter your First Name and Last Name for the certificate of this application. Fill out the other needed information and click Okay.

You can check the remember password, then click Next. Select release on the build variants and tick the two boxes namely V1 and V2. Then click on finish.

That’s it. It will start to build the APK. It will tell you if its already ready. Locate the APK file. Congratulations on your first app.