Skip to main content

How to Convert Your JavaScript/HTML5/CSS Into an Android App

Are you looking to turn your JavaScript application into a mobile Android application. Let us learn how to Convert your JavaScript/HTML5/CSS into an Android App using android studio. You write your web app in HTML5, JavaScript and CSS, and android studio helps you to turn it into Android app.

Convert Your JavaScript/HTML5/CSS Into an Android App:How to Convert Your JavaScript/HTML5/CSS Into an Android App

1. Click here to download Android Studio
2. Install Android Studio on you computer
3. Click Start a new Android Studio projectHow to Convert Your JavaScript/HTML5/CSS Into an Android App
4. Configure your new project with Application name and Company domainHow to Convert Your JavaScript/HTML5/CSS Into an Android App
5. Select the form factors your app will run on and click next
(Lower API levels target more devices, but have fewer features available)How to Convert Your JavaScript/HTML5/CSS Into an Android App
6. Select Empty ActivityHow to Convert Your JavaScript/HTML5/CSS Into an Android App
7. In Customize the activity, leave it as defaultHow to Convert Your JavaScript/HTML5/CSS Into an Android App
8. Goto Activity_main.xml in Android Studio and click Text view (bottom)
9. Do the below changes to convert it from Textview to WebView

TextView to WebView
android:text=”Hello World!” to android:id=”@+id/webView”

Before:How to Convert Your JavaScript/HTML5/CSS Into an Android App

After:How to Convert Your JavaScript/HTML5/CSS Into an Android App

10. Goto MainActivity.java tab and add the below lines,

WebView webView = (WebView)findViewById(R.id.webView);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebChromeClient(new WebChromeClient());
webView.loadUrl(“file:///android_asset/www/index.html”);

Before:
How to Convert Your JavaScript/HTML5/CSS Into an Android App

After:How to Convert Your JavaScript/HTML5/CSS Into an Android App
11. In left side, right click on app, New, Folder and click Assets Folder
It will create a assets folder under appHow to Convert Your JavaScript/HTML5/CSS Into an Android App

How to Convert Your JavaScript/HTML5/CSS Into an Android App
12. Right click on the assets folder, New and click DirectoryHow to Convert Your JavaScript/HTML5/CSS Into an Android App
13. Enter new directory name as: wwwHow to Convert Your JavaScript/HTML5/CSS Into an Android App
14. Right click on the www folder, New and click FileHow to Convert Your JavaScript/HTML5/CSS Into an Android App
15. Enter new file name as: index.htmlHow to Convert Your JavaScript/HTML5/CSS Into an Android App
16. write your java-script in index.html How to Convert Your JavaScript/HTML5/CSS Into an Android App
17. Click the play button on the tool bar to run the Virtual deviceHow to Convert Your JavaScript/HTML5/CSS Into an Android App
18. Click Create New Virtual Device and select the device
19. Android Emulator will open with our applicationHow to Convert Your JavaScript/HTML5/CSS Into an Android App
We Successfully Convert Your JavaScript/HTML5/CSS into an Android App using android studio

How to Convert Any Website into Android Application

One thought on “How to Convert Your JavaScript/HTML5/CSS Into an Android App

Leave a Reply

Your email address will not be published. Required fields are marked *