Thursday, May 19, 2011

Node.js on Android

I'm trying to make the recently popular (well, maybe not so recently) Node.js run on Android. So far, I've succeeded in getting it to run on the ISO1, a smartphone running Android 1.6, but only by doing the following.

Here are the basic steps:

Root the IS01
Use qemu to build a Linux on an ARM environment
Use the ARM Linux environment to build Node.js
Copy the Node.js binary to the IS01


Rooting the IS01

This step requires root permissions on Android to get Node.js running, since we need to create a lib directory in which to place shared libraries.
To root the device quickly, we'll follow the directions in the MobileHackerz Blog: Getting Root Permissions for the au IS01, build 01.00.09(Japanese).
Following the directions there is an easy way to get root.

Things to watch out for:
Turn USB debugging on.
Settings => Applications => Development => USB debugging
Install ChainsDD Superuser.
Install it from the Android Market
Try repeatedly until it works.
Using qemu to build Linux on an ARM environment
Using qemu allows us to emulate an ARM CPU, and build a virtual environment. We'll install debian on qemu, and from there build Node.js. This will get us a Node.js binary that can run on an ARM processor.

Read more: AMT blog