View all files | ||||
NativeScript is an open-source framework for building truly native mobile applications using JavaScript. This repository contains the source code for the Node-API based Android Runtime used by NativeScript.
The Android Runtime is a key component of the NativeScript framework. It is responsible for executing JavaScript code on Android devices. The runtime is built on top of Node-API and provides a way to interact with the Android platform APIs from JavaScript.
The new runtime is based on the Node-API and is designed to be more stable, faster, and easier to maintain. It also supports multiple JavaScript engines, including V8, QuickJS, Hermes, and JavaScriptCore.
The repo is structured in the following projects (ordered by dependencies):
Following are the minimal prerequisites to build the runtime package.
Install the latest Android Studio.
From the SDK Manager (Android Studio -> Tools -> Android -> SDK Manager) install the following components:
Clone the repo:
Set the following environment variables:
Run the following commands to build the runtime:
The command will let you interactively choose the JS engine you want to build with. i.e V8, QuickJS, Hermes or JSC, PrimJS, Static Hermes.
Go to subfolder test-app after you built the runtime.
Start an emulator or connect a device.
Run command
Note: You might need to run the Android Studio from the command line in order to preserve the environment variables. This is in case you get errors like "missing npm" if starting the studio the usual way.
You can change the JS engine used by the runtime by setting the jsEngine property in the build.gradle file in the root of the project. The possible values are QUICKJS, HERMES, JSC or V8.
We love PRs! Check out the contributing guidelines. If you want to contribute, but you are not sure where to start - look for issues labeled help wanted.
Please, use github issues strictly for reporting bugs or requesting features. For general questions and support, check out Stack Overflow or ask our experts in NativeScript community on Discord.
This project is licensed under the Apache License Version 2.0. See the LICENSE file for more info.