Skip to content

Repository files navigation

Export-QBasicJS-to-HTML-with-JS-and-create-Android-APK-after-that

I have found the solution on how to create Android APK from HTML and JS files generated by QBJS.

Please, take a look at this link https://htmltopdf.live/html-to-apk-converter/

First, I have exported from QBJS the sample of simple web calculator into folder with HTML and JS files.

Then I have created Android APK from HTML.

After that I had built Android APK with "ANT" utility and Android Studio. For Android 9+.

Now the calculator works fine on my smartphone.

More information on screenshots attached.

First Second Third Result

If you want to try any other QBJS samples in this way, please see screenshots and instruction.

  1. Install Android Studio, the old version with "Ant". The SDK folder will appear on the disk.

The build script should be located in the \sdk\tools\ant folder.

  1. Or install the current version of Android Studio.

Then add the old version of tools with "Ant" to the SDK folder.

You can find and download it separately on the Internet. For example, search in Browser under these names tools_r18-windows.zip tools_r23-windows.zip tools_r24-windows.zip

2026-06-03_13-19-49 2026-06-03_13-20-17 2026-06-03_13-21-02
  1. Open the build.xml script in the \sdk\tools\ant folder, find and edit its contents so, that it becomes

was 1.5 was 1.5

  1. Download and install "Ant" separately in a separate directory on the hard disk. For example, C:\Android\apache-ant-1.10.15-bin\

  2. Open Android Studio and install the appropriate Android platforms on the disk in the SDK folder. For example, android-29. This is Android 10.

  3. Install Java 8 or 17.

  4. Create suitable paths in Windows OS system variables to JAVA, Android SDK, ANT, etc.

ANDROID_HOME = path to the Android SDK folder on yandex.disk %ANDROID_HOME%\build-tools %ANDROID_HOME%\platform-tools %ANDROID_HOME%\platform %ANDROID_HOME%\tools

JAVA_HOME = path to JDK

ANT_HOME = path to ANT (to the bin directory)1.

  1. Download the BasicJS project to the root disk. I did it in C:

  2. Open the project folder in a separate Windows window.

  3. Open the '/android' subfolder.

Make sure that HTML and JS files and etc are in the subfolder '/android/assets'.

2026-06-03_12-48-57 2026-06-03_13-06-06 2026-06-03_13-06-25 2026-06-03_13-15-15
  1. Check the paths and settings in the local.properties and default.properties files.
2026-06-03_13-18-44 2026-06-03_13-19-22 2026-06-03_13-52-02
  1. Open the terminal using the Windows command "cmd" and navigate to the project folder in the "android" subfolder.

  2. Run the command in the terminal - 'ant release' (from the android subfolder).

  3. After successful build of apk it is located in the android\bin subfolder. APK is not signed.

2026-06-03_13-03-47 2026-06-03_13-04-29
  1. To sign the apk, use any suitable manager. I use MT Manager. For Android.

  2. Transfer the unsigned apk to your smartphone in your favorite way.

  3. Install and open MT Manager. On a smartphone.

18.1. Find the required apk inside MT Manager.

18.2 Press and hold your finger on the apk file for a long time, a context menu will appear. 18.3. Select the Signature item in menu. 18.4. A new window will open. 18.5 Do not change anything in the settings. Click OK. Then click Close. 18.6. The new signed apk file will appear in the same MT Manager directory.

  1. Install the apk as a regular Android application.

  2. Launch the application.

As you can see in MainActivity.java in \android\src\main\java\com\myapp\html, the Android application is based only on two Java Classes

  1. WebView A View that displays web pages as Browser does

  2. WebViewClient

These Java Classes are provided by package "android.webkit".

See section of the imported packages in java file

MainActivity.java in folder

\android\src\main\java\com\myapp\html

For to create more complicated and powerfull apps it is required to study all about Android webkit package.

Please, take a look at this link https://developer.android.com/reference/android/webkit/package-summary

2026-05-24_17-32-28

About

Simple Web-calculator was exported from QBJS for to create Android APK after that. For Android 9+. The app works fine on my smartphone.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages