Viable options for running NodeJS on Android (Aug 2017)

Viewed 10282

There are a bunch of old SO threads dealing with running NodeJS on Android. Most of these are no longer viable (JXCore) and/or provide confusing, outdated, incomplete, or erroneous information.

Therefore I have investigated what seems to be currently (as of August 2017) viable approaches and found three likely candidates.

To decide between them I would like to know:

  • the primary differences between these approaches
  • specific pro's and con's on each approach
  • likely hurdles, challenges and shortcomings
  • do you know of other viable alternatives?

Viable approaches are:

  1. Running V8 javascript engine which includes NodeJS (J2V8)
  2. Use NodeJS directly, embedded as native library (node-on-android)
  3. Combining React Native with NodeJS app-as-a-service (react-native-node)

Besides that I have found a number of related interesting resources:

  • NPM install NodeJS directly using Termux without rooting (not for end-users)
  • LiquidCore - native mobile micro-app devenv (not investigated, interesting concepts)
  • dna2oslab - has a working NodeJS build script for node executables
  • Building NodeJS for Android - blog with useful compilation tips and example project
5 Answers

I am the author of LiquidCore. LiquidCore allows you to use full implementations of Node.js on both Android and iOS (iOS support was just released in version 0.5.0 -- September 2018).

LiquidCore is designed to enable multiple instances of Node to run simultaneously inside of a native mobile app. Each instance has its own virtual file system and native support for MySQL. The goal of the project is to enable full "micro apps" to be built using JavaScript/WebAssembly that can then be embedded into other apps, and I am still working toward that goal. But as of today, it works great if you just want a Node.js playground.

If you want to see what it can do, there is a simple node console app included for both Android and iOS.

Related