Website To Apk Convert Easy Way

Android Studio

Posted by indranil on Feb. 5, 2021, 12:13 p.m.

How To Convert Website Into Android Application?

In this mobile-first world, having just a website isn’t sufficient for a great digital presence. Having a mobile app will help you to acquire more customers and grow the revenue of your business. If you have a B2C website and still haven’t planned for having an app then you are missing great revenue opportunities. With a mobile app, you can make it is easy for people to discover your products and services right at their fingertips. Let us have a look at how you can Convert Website Into Android Application and the benefits of doing it.

Convert Website Into Android Application Using Online Tool

You can use a third-party online tool which will help you convert your web application into native Android and iOS mobile apps. Some of these tools offer a free trial. These tools also allow you to add functionalities such as push notifications, WebView, and animations. One such tool is GoNative which allows you to include additional functionalities by selecting features in the checkbox. You can try GoNative here.

Another online third-party tool is AppyPie. It is also very similar to GoNative but it allows you to see your app in an online emulator so that you can see your changes in real-time.

Convert Website Into Android Application Using Android Studio

If you want to build an app in simple then you can use WebView. Before you start installing Android Studio and start building an app, your website should be responsive and mobile-ready. You can take Google’s mobile-friendly test to check if your website is optimized for mobile devices or not. Once you have completed the test, you can follow the below steps.

Step 1: Get Ready With Android Studio

*Install Android Studio

*Create Empty Project

*Changes Some Project Files

Step 2: Create App Interface And WebView Element

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.nodomain.coder_i">
<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">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

MainActivity.java

//COPY All Of Code And Paste On Your MainActivity.java under package.your_pkg_name;


import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Bitmap;
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) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mywebView=(WebView) findViewById(R.id.webview);
mywebView.setWebViewClient(new WebViewClient());
mywebView.loadUrl("https://example.com/");
WebSettings webSettings=mywebView.getSettings();
webSettings.setJavaScriptEnabled(true);
}

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

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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">


<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
 

styles.xml

<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>


_____________COMPLETE____________


 

Build Your Apk

Android-Studio Top Navbar- Build-Generate Signed Bundle/APK..

After Complete Process You Locate Your File On   app\release

____________________________________________________

noimg Visit Link: digitalocean.com