Advertising (This ad goes away for registered users. You can Login or Register)

[tutorial]html5 assets in android apk (portals to apk)

Discuss about your favorite (gaming...or not) devices here. The most popular ones will end up getting their own categories
Programming discussions for your favorite Device
Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
Post Reply
Posts: 31
Joined: Wed Jan 14, 2015 10:17 pm

[tutorial]html5 assets in android apk (portals to apk)

Post by ivo2376 »

// You can build your application using
// - Android Studio

package com.example.nick.glidematrixwebgl;

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

public class MainActivity extends AppCompatActivity {

protected void onCreate(Bundle savedInstanceState) {
WebView webiew= (WebView)
//go stand on the first webiew en press alt-eneter for binding java to xml ...

<?xml version="1.0" encoding="utf-8"?>
< xmlns:android=""


android:layout_height="match_parent" >


//heres the rest of the read
In the learn section on ios mobile insololearn app quoted
press learn press view more open android webview
You can convert your HTML/CSS/JS code below as required in steps
first develop/download all the html js css u need
so it works in a browser or in codeplayground

1)Create a new project in android Studio choose empty activity
(correct me if im wrong)
2)Observer the structure of your project
Create an assets folder in the root app
Then create 3 files index.html index.js and index.js in the assets folder as file
Right Click assets => Click new => Click File to do that
3)Add the corresponding HTML/CSS/JS code to the newly created files
4)Use <link> and <script> elements to link the .css .js files in the .html file
5)Open your main activity XML file (activity_main.xml)
if you didnt change any names during project creation
in the layout (app/main/res/layout) folder.
Insert the below code inside the parent layout element:


android:layout_height="match_parent" >

This will create a WebView, that will stretch the entire screen

6)Open your main activity JAVA file(
if you didnt change any names during project creation
within the java (app/main/java) folder.
insert the below code inside the onCreate() method

WebView webView= (WebView)

Replace myHtml.html or inde.html with ur linkings in html naming
7)Optional Customize your WebView
8)Build The APK. Build an APK.

Thats it! You just converted your webcode into an android app!
Now go code ur favorite app again in html and export it to an APK.

now for the assets dir there a separete read. ... oid-studio

intresting read about questions about assets folder

and a youtube video if ur not convinced
video guide of the above underneeth

Converting a HTML+CSS+JS Code into an Android App using Android Studio!
This video demonstrates how to create an android app from a HTML+CSS+JS code using Android Studio IDE.
demo project (jslinux_mobile_for_ios) html5 shows browser agent is not ios problem for html5 portal jlinux-mobile-for-ios
working remake rebuilded with grepple dubbed JSLinux-mobile-online(since its an apk directly using the internetlink)
(without assets)

jslinux-mobile working url ... &options=1
Post Reply

Return to “Programming and Security”