CodrGeek is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic understanding. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our Privacy Policy Explore Now!

How to Convert Any Website to Android App in Android Studio?

Simple Steps to Convert Your Website into an Android Application.

Here, we are going to make an application for the “GeeksForGeeks” website. By making this application we will be able to learn how we can convert a website to an Android Application just by following simple steps. You can use this concept for your personal website too and learn something new.



What we are going to build in this article? .


In this application, we will learn how we can use different portals of a website and show them as fragments in our android application. In this application three portals of the Geeksforgeeks website- Home, Practice and Contribute will be used as fragments in our application. So, you can see a live example to convert a website into an application. The concept of WebView is used to do this desired work. A sample video is given below to get an idea about what we are going to do in this article. We are going to implement this project using both Java and Kotlin Programming Language for Android.

Simple Steps to Convert Your Website into an Android Application:.

  • To add the logo of your application.
  • To add a splash screen to your application.
  • To use the Navigation drawer in our application so that, different portals of our website can be used as fragments in the navigation drawer.
  • To use a WebView so that, the web content can be accessed easily.
  • To use WebViewController class so that the content on the Website can be directly shown in the application rather than opening it in the browser.
  • To add a helpline activity.

  • And by following these steps you can convert your website to an application in the simplest way. So, let us see a step-by-step implementation to convert GeeksForGeeks Website into an application.


<WebView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/webView"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true"
    tools:ignore="MissingConstraints" />


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

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    String websiteURL = "https://coupon.technovedant.com/"; // sets web url
    private WebView webview;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //Webview stuff
        webview = findViewById(R.id.webView);
        webview.getSettings().setJavaScriptEnabled(true);
        webview.getSettings().setDomStorageEnabled(true);
        webview.setOverScrollMode(WebView.OVER_SCROLL_NEVER);
        webview.loadUrl(websiteURL);
        webview.setWebViewClient(new WebViewClientDemo());

    }

    private class WebViewClientDemo extends WebViewClient {
        @Override
        //Keep webview in app when clicking links
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            return true;
        }
    }

}


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


About the Author

Hey there! My name is Mayank, a professional Blogger, Graphic Designer, Coder as well as Content Creator from Uttar Pradeh, India. I love to Code and create interesting things while playing with it.

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.