forked from nodejs/node-v0.x-archive
-
Notifications
You must be signed in to change notification settings - Fork 1
Home
rocguo edited this page Jul 10, 2013
·
18 revisions
The porting is done for tag v0.8.23-android and branch v0.8-android, but no 'npm'.
This is Node.js v0.8 Android porting, but no 'npm'. The work is based on peddybyer's previously porting work on v0.6, but with some clean up and bug fix (e.g. loading native addons). I tried to load native addon, and it works. While to do so, you have to compile it using Android ndk manually.
For additional modules, since we don't have 'npm', one way is to install them under Linux at first, then push the node_modules directory to Android. Modules tested include socket.io.
Prerequisites:
* Android ndk (r7b and r8c are tested)
Linux:
# checkout node, openssl-android & pty under same directory
$ git clone git@github.com:rocguo/node.git
$ git clone git@github.com:rocguo/openssl-android.git
$ git clone git@github.com:rocguo/pty.git
# checkout node tag v0.8.23-android or v0.8-android
$ cd node
$ git checkout v0.8.23-android
# go to sub direction android
$ cd android
# use build_android.sh to start the build, make sure ndk-build can be found in PATH
$ ./build_android.sh -j 4
# the executable will be in libs/armeabi
$ ls libs/armeabi
* adb push node to android device, e.g. /data/local/node
* add execute file permission and run
* for additional modules, copy to android manually, and set NODE_PATH