Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run my node.js project on android?

I have a working php server on my android tablet, so I hope it's available somehow to run nodejs also. The source code is available on github, and it can be build on linux also, but I can't really understand, how to build it.

Thanks in advance,

like image 281
Danny Fox Avatar asked Jul 09 '12 09:07

Danny Fox


People also ask

Can I run node js on Android?

Android JS provides Node JS runtime environment, So you can use any 'npm' package in your app.

Can NodeJS run on mobile?

A full-fledged Node.js for Mobile Apps is a Node. js runtime that runs on Android and iOS, using the V8 JavaScript engine. It is very similar to a Linux build of Node, but with a few platform-specific tweaks and fixes.

How do I run a node file in Termux?

Make sure you've first installed the termux-api on your Android device from the Play store. Then install the scripts with apt install termux-api. Finally get this node module: $ npm install --save termux Example usage const api = require('termux') if (!


1 Answers

The instructions for a build are missing from the website:

  1. Download it:

    wget http://nodejs.org/dist/v0.8.1/node-v0.8.1.tar.gz

  2. Unpack it:

    tar xzf node-v0.8.1.tar.gz

  3. Go to the unpacked folder:

    cd node-v0.8.1/

  4. Run

    ./configure && make && sudo make install

You might need to install some dependencies like g++ or build-essential, curl and libssl-dev first.

There is also a packaged Android port but it doesn't seem to be actively mantained.

edit: apparently you need to modify some build options according to your device. A google search for "node android" + your model should give you more details. Here are they for the G1 and Galaxy S: http://mitchtech.net/node-js-on-android-linux/

like image 150
Ricardo Tomasi Avatar answered Sep 22 '22 20:09

Ricardo Tomasi