[Free] How to Convert website into Professional Android App Using ANDROID STUDIO 2023 [HINDI]

 Convert website into Professional Android App

Today we know. How to convert your website into professional Android app using Android studio? We implement many features in our app.

Convert website to Android app for free

Convert website to android app source code GitHub

We create our app in Android Studio freely. I am available in source code of this app. 

You can publish your app in Google Play store. And earn money by Ad Mob. See all step completely and get your app. If you’re facing any error, please comment. Below the post.

Source Code: How to Convert website into Professional Android App

Step 01 – How to Download Android Studio

  • Open Browser
  • Search Android Studio on google
  • Go to official Website
  • Download Software
  • Install Software

Step 02 – How to Create Project in Android Studio

  • Open “Search bar” in pc
  • Type “Android”
  • Click on first Software
  • Click to “Create Project” in Android Studio
  • Set your app Name.
  • Set your own “Package Name”
  • Set your “Project Location”
  • Select Language.
  • Select Minimum SDK Version.
  • Click on “Finish”

Step 03 – How to Open JAVA and XML File in Android Studio

  • Activity Main JAVA
  • Main Activity XML
  • Manifest 

Step 04 – How to Remove Action Bar in Android App – Android Studio

  • To remove Action bar > go to theme >  Replace “DAYNIGHT” into “No” 

Step 05 – How to set or add logo in android app in Android Studio

  • Add app Logo > res > new > Image assist > select logo > resize > remove Bg > finish

Step 05 – How to add internet permissions in android studio – android Studio.

Internet Connection Error in android Studio

  • Copy Code > Go to “AndroidManifest.xml ” > find “manifest” > Paste Code

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

  • Copy Code > Go to “AndroidManifest.xml ” > find “manifest” > Paste Code

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

Step 06 – How to add webView (XML) in Android App – Android Studio

Activity Main XML

  • Copy Code > Go to “Activity_Main.xml” > Remove “TextView” > Paste Code

<WebViewandroid: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”/>

Step 07 -How to add webView (Java) in Android App – Android Studio

Main Activity  JAVA

  • Copy Code > Go to “Main Activity  Java” > Prevent Package name or remove all code  > Paste Code
  • Insert Your Website URL on highlight text (red).

import

android.os.Bundle;import

android.webkit.WebView;import

android.webkit.WebViewClient;import

androidx.appcompat.app.AppCompatActivity;public class

MainActivityextends

AppCompatActivity {

StringwebsiteURL

=”https://myb21.com/”;// Add your website urlprivate

WebViewwebview;@Overrideprotected voidonCreate

(Bundle savedInstanceState) {super

.onCreate(savedInstanceState);

setContentView(R.layout.activity_main

);//Webview stuffwebview

= 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

WebViewClientDemoextends

WebViewClient {@Override//Keep webview in app when clicking linkspublic booleanshouldOverrideUrlLoading

(WebView view,

String url) {
view.loadUrl(url);return true;

}
}

}

Step 08 -How to solve internet connection error in android app – Android Studio

MainActivity.java With Internet connection Code

Copy Code > Go to “Main Activity  Java” > Prevent Package name or remove all code  > Paste CodeInsert Your Website URL on highlight text (red).import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.util.Log;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity { String websiteURL = “https://myb21.com/”; // add your website url
private WebView webview;

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

if( ! CheckNetwork.isInternetAvailable(this)) //returns true if internet available
{
//if there is no internet do this
setContentView(R.layout.activity_main);
//Toast.makeText(this,”No Internet Connection, Chris”,Toast.LENGTH_LONG).show();

new AlertDialog.Builder(this) //alert the person knowing they are about to close
.setTitle(“No internet connection available”)
.setMessage(“Please Check you’re Mobile data or Wifi network.”)
.setPositiveButton(“Ok”, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
})
//.setNegativeButton(“No”, null)
.show();

}
else
{
//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;
}
}}class CheckNetwork {private static final String TAG = CheckNetwork.class.getSimpleName();

public static boolean isInternetAvailable(Context context)
{
NetworkInfo info = (NetworkInfo) ((ConnectivityManager)
context.getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo();

if (info == null)
{
Log.d(TAG,”no internet connection”);
return false;
}
else
{
if(info.isConnected())
{
Log.d(TAG,” internet connection available…”);
return true;
}
else
{
Log.d(TAG,” internet connection”);
return true;
} }
}
}

Step 09 How to set Back & Exit Feature In Android App – Android Studio

  • Copy Code > Go to “Main Activity  Java” > private class (web view client demo)  > Paste Code

//set back button functionality@Overridepublic voidonBackPressed

() {//if user presses the back button do thisif

(webview

.isFocused() &&webview

.canGoBack()) {//check if in webview and the user can go backwebview

.goBack();//go back in webview

}else

{//do this if the webview cannot go back any furthernew

AlertDialog.Builder(this

)//alert the person knowing they are about to close

.setTitle(“EXIT”

)
.setMessage(“Are you sure. You want to close this app?”

)
.setPositiveButton(“Yes”, new

DialogInterface.OnClickListener() {@Overridepublic voidonClick

(DialogInterface dialog, int

which) {
finish();

}
})
.setNegativeButton(“No”, null

)
.show();

}
}

Step 10 – How to add Swipe Down to Refresh In Android App (xml File) – Android Studio

  • Copy Code > Go to “Activity Main XML” >   > Paste Code (Replace with Webview)

<androidx.swiperefreshlayout.widget.SwipeRefreshLayout android:id=”@+id/swipeContainer” android:layout_width=”match_parent” android:layout_height=”match_parent”> <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” /></androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

Step 11 – How to add Swipe Down to Refresh In Android App (Java File) – Android Studio

Code 01

  • Copy Code > Go to “Main Activity  Java” > go to web link below surface ( below Private web view)  > Paste Code

SwipeRefreshLayout mySwipeRefreshLayout;

Code 02

  • Copy Code > Go to “Main Activity  Java” >  web view stuff  – (onCreate)  > Paste Code

//Swipe to refresh functionalitymySwipeRefreshLayout

= (SwipeRefreshLayout)this

.findViewById(R.id.swipeContainer

);mySwipeRefreshLayout

.setOnRefreshListener(new

SwipeRefreshLayout.OnRefreshListener() {@Overridepublic voidonRefresh

() {webview

.reload();

}
}
);

Step 12 – How to add Swipe Down to Refresh In Android App (Java File) – Android Studio

  • Copy Code > Go to “Main Activity  Java” > go to private class webview client demo  > Paste Code 

private class

WebViewClientDemoextends

WebViewClient {@Override//Keep webview in app when clicking linkspublic booleanshouldOverrideUrlLoading

(WebView view,

String url) {
view.loadUrl(url);return true;

}@Overridepublic voidonPageFinished

(WebView view,

String url) {super

.onPageFinished(view,

url);mySwipeRefreshLayout

.setRefreshing(false

);

}
}

Step 13 How to Convert website into Professional Android App Using ANDROID STUDIO 2023 [HINDI] -Complete Java file Code

package

com.myb21.p04cpdfdownload;import

android.app.AlertDialog;import

android.content.Context;import

android.content.DialogInterface;import

android.net.ConnectivityManager;import

android.net.NetworkInfo;import

android.os.Bundle;import

android.util.Log;import

android.webkit.WebView;import

android.webkit.WebViewClient;import

androidx.appcompat.app.AppCompatActivity;import

androidx.swiperefreshlayout.widget.SwipeRefreshLayout;public class

MainActivityextends

AppCompatActivity {

StringwebsiteURL

=”https://youtube.com/technicalsangrah”;// sets web urlprivate

WebViewwebview;

SwipeRefreshLayoutmySwipeRefreshLayout;@Overrideprotected voidonCreate

(Bundle savedInstanceState) {super

.onCreate(savedInstanceState);

setContentView(R.layout.activity_main

);if

( ! CheckNetwork.isInternetAvailable

(this

))//returns true if internet available

{//if there is no internet do this

setContentView(R.layout.activity_main

);//Toast.makeText(this,”No Internet Connection, Chris”,Toast.LENGTH_LONG).show();new

AlertDialog.Builder(this

)//alert the person knowing they are about to close

.setTitle(“No internet connection available”

)
.setMessage(“Please Check you’re Mobile data or Wifi network.”

)
.setPositiveButton(“Ok”, new

DialogInterface.OnClickListener() {@Overridepublic voidonClick

(DialogInterface dialog, int

which) {
finish();

}
})//.setNegativeButton(“No”, null)

.show();

}else

{//Webview stuffwebview

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

}//Swipe to refresh functionalitymySwipeRefreshLayout

= (SwipeRefreshLayout)this

.findViewById(R.id.swipeContainer

);mySwipeRefreshLayout

.setOnRefreshListener(new

SwipeRefreshLayout.OnRefreshListener() {@Overridepublic voidonRefresh

() {webview

.reload();

}
}
);

}private class

WebViewClientDemoextends

WebViewClient {@Override//Keep webview in app when clicking linkspublic booleanshouldOverrideUrlLoading

(WebView view,

String url) {
view.loadUrl(url);return true;

}@Overridepublic voidonPageFinished

(WebView view,

String url) {super

.onPageFinished(view,

url);mySwipeRefreshLayout

.setRefreshing(false

);

}
}//set back button functionality@Overridepublic voidonBackPressed

() {//if user presses the back button do thisif

(webview

.isFocused() &&webview

.canGoBack()) {//check if in webview and the user can go backwebview

.goBack();//go back in webview

}else

{//do this if the webview cannot go back any furthernew

AlertDialog.Builder(this

)//alert the person knowing they are about to close

.setTitle(“EXIT”

)
.setMessage(“Are you sure. You want to close this app?”

)
.setPositiveButton(“Yes”, new

DialogInterface.OnClickListener() {@Overridepublic voidonClick

(DialogInterface dialog, int

which) {
finish();

}
})
.setNegativeButton(“No”, null

)
.show();

}
}

}class

CheckNetwork {private static final

StringTAG

= CheckNetwork.class

.getSimpleName();public static booleanisInternetAvailable

(Context context)
{
NetworkInfo info = (NetworkInfo) ((ConnectivityManager)
context.getSystemService(Context.CONNECTIVITY_SERVICE

)).getActiveNetworkInfo();if

(info ==null

)
{
Log.d

(TAG,”no internet connection”

);return false;

}else

{if

(info.isConnected())
{
Log.d

(TAG,” internet connection available…”

);return true;

}else

{
Log.d

(TAG,” internet connection”

);return true;

}

}
}
}

Code 13

 Screen Rotation:

  • add in manifest

android:screenOrientation=”portrait”>

Q&A

  • Convert website to Android app for free
  • Convert website into app
  • Convert website into app free
  • Convert website into Android app
  • Convert website to android app source code GitHub
  • Convert website to mobile app
  • Convert website to Android app with push notifications
  • Convert website to APK free

4 comment on “[Free] How to Convert website into Professional Android App Using ANDROID STUDIO 2023 [HINDI]”

  • Science BE21 April 2, 2024
    Reply

    Dear Sir, My Android New project is showing Kotlin instaed of Java. Please tell me how to create .APK file using kotlin in Android.
    Thanks and regards

    • Science BE21 April 2, 2024
      Reply

      bhai abhi mene android development chod diya he

  • Science BE21 December 12, 2023
    Reply

    Code not work properly

    • Science BE21 December 14, 2023
      Reply

      i will update soon

Write a comment