Convert Responsive website into Android App

Convert Responsive website into Android App








Hello Readers, 
In today's world, we all know how important apps are for starting a business and here I'm here to help you to build your android app using your website.

Requirements :

  • Responsive Website having the mobile view
  • A website like Flipkart which is properly responsive like when you open it in your browser it open with the App interface.
For Example:
        Eccomerce Websites: Flipkart website, Amazon Website
        Course website:  Udemy, Coursera, etc.

Live Example :

WordPress website to Android App

Steps to follow to create responsive Website : 

  • Select Responsive WordPress Themes for Example Electro WordPress themes for Eccomerce Website
  • after installing Electro thems just update the website with products or changes that you want to do.
  • that's it you are done with the website 

Steps to follow to create an Android App with a responsive Website : 

  • Open Android Studio:  Click on Start new Android Studio Project
Android Studio Tutorial New Project

  • Enter Your Application Name: As per your preference and after entering data click on next button.
android studio tutorial create new project

  • Select Blank Activity; Click next button
android studio tutorial select activity

  • Click Next. This screen is an Activity configuration screen. Since you asked ADT to create an activity for you, this screen helps you in configuring relevant options.\
android studio project customize activity


  • Open Main_Activity.xml and paste below code
Android WebView component is inserted into the XML layout file for the layout we want the WebView to be displayed in. In this example we insert it into the activity_main.xml file as shown below:

            <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:orientation="vertical">


<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">


<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<WebView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/webview1"></WebView>

</LinearLayout>


</ScrollView>>

</LinearLayout>


  • Open MainActivity.Java file
      Paste below code on MainActivity.java file


  Note: Paste code below package name in java file

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

public class MainActivity extends Activity {

private WebView webView = null;

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

webView = (WebView) findViewById(R.id.webview1);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("https://demo3.madrasthemes.com/electro/v2/home-v2");
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
}
@Override
public void onBackPressed() {
if (webView.canGoBack()) {
webView.goBack();
} else {
super.onBackPressed();
}
}
}



  • Connect your Android mobile and on Debugging mode and Run App in your mobile phone

     









Comments