Skip to content
paddybyers edited this page Oct 19, 2011 · 25 revisions

Set up the build environment

These instructions should work on Mac and Linux. Windows/cygwin is not investigated yet. If you get this to work, please send the details and it will be added to the wiki.

Get the latest Android SDK and NDK. You need to install support for the android-9 platform.

Install a recent version of Python 2.x.

Install Git.

Download the code

Create a directory that will contain all of the repositories you need. Starting in <work dir>, do

mkdir anode
cd anode

Clone each of the repositories in turn.

git clone git://github.com/paddybyers/anode.git
git clone git://github.com/guardianproject/openssl-android.git
git clone git://github.com/paddybyers/pty.git
git clone git://github.com/paddybyers/node.git

This last repository has a v0.4-android branch that contains the Android port.

Environment variables

NODE_PATH must point to the root of the node repo just created. NDK_MODULE_PATH must point to the immediate parent directory of each native android module.

export NODE_PATH=<work dir>/node
export NDK_MODULE_PATH=<work dir>/anode:<work dir>/anode/anode

Build the native code

cd anode/libnode
ndk-build

Once the native library is built, this needs to be included as an asset in the top-level Android project:

ln -s libs/armeabi/libjninode.so ../app/assets/libjninode.so

Or if you prefer (or on Windows), edit the top-level makefile to add an install target to perform the copy.

Set up the Eclipse Android projects

Open Eclipse and do:

File->Import->General->Existing projects into workspace

Point to the <work dir>/anode/anode directory and import both the app and libnode projects.

You are now ready to build and run.

Clone this wiki locally