Launch NodeJs Server on Android

Is it possible to run the NodeJs server on an Android device (for example, Linux devices, not Android applications).

If possible, please help me do this.

And is it possible to run a mongo server on an Android device?

My devices:

  • RK3288 TV Box (android 4)
  • Asus fonepad 7 (android 5 root)
  • LG Optimus G (Android Root 4)

Important!! I want to run a server application in Android. because I have an unused TV-Box for Android and I want to use it on my home server.

And I do not want to use it in APK files (for loading html files in WebView s). I need a nodejs server, not a javascript client with CommonJs and RequireJs

+6
android android-ndk root server
Jun 29 '15 at 8:48
source share
3 answers

You might want to install chrooted-linux on your Android device, as described here .

In short, do the following:

  • prepare linux image
    • do it on any gnu + linux device.
    • create a large file (> 1 GB)
    • format it as a file system (e.g. ext2)
    • mount it.
    • copy the distribution inside it (for example, using debootstrap)
  • copy loopdevice in android
  • install it (root required)
    • maybe install busybox
    • attach some directories from the root device to the host (usually dev , dev/pts , proc and sys )
  • root
  • install nodejs inside chroot

note: I did something similar to my tf301 and it works like a charm. But when I start to use too much memory inside the chroot (for example, when compiling an android application), the host fails. I have not encountered these accidents with node yet, and I do not know if this will affect other devices.

+3
Dec 16 '15 at 10:15
source share

Install jxcore as described here :

Express on Android

The script assumes that the Apache Cordova and Android SDK are installed on your system. If this is not the case, refer to the separate documentation on how to do this.

Plug the Android device into the USB socket (with USB debugging turned on) if you do not want to run the application on the Android emulator.

Download the script and save it in an empty folder. Run it with the name of the model folder as an argument, for example "express sample":

 $ ./install_and_run.sh "express sample" 

The script can be found here .

+3
Dec 16 '15 at 10:20
source share

J2V8 is the best solution to your problem. It runs the Nodejs application on jvm (java and android).

J2V8 is Java bindings for V8, but Node.js integration is available in J2V8 (version 4.4.0)

Github: https://github.com/eclipsesource/J2V8

Example: http://eclipsesource.com/blogs/2016/07/20/running-node-js-on-the-jvm/

0
Aug 17 '17 at 11:26 on
source share



All Articles