- Slides: 19
Node. js on Android 김상선
Node. js Architecture Java Script C / C++ V 0. 10 기준
Anode • Framework for running node. js applications on Android • Running node. js applications through an intent-based API • Anode uses ver 0. 6
Anode Build • These instructions should work on Mac and Linux. • Windows/cygwin is not fully working yet.
Anode Build • Set up the build environment • Get the latest Android SDK and NDK. • (But NDK ver. recommend r 8 d) • Install a recent version of Python 2. x. • Install Git.
Anode Build • Prerequisites - SSL • anode depends on the openssl libraries libssl. so and libcrypto. so • Starting in <work dir>, clone the repo: – & git clone git: //github. com/paddybyers/opensslandroid. git • To build it: – & cd openssl-android – & ndk-build
Anode Build • cd back to <work dir>. • Clone each of the repositories in turn. • git clone git: //github. com/paddybyers/anode. git • git clone git: //github. com/paddybyers/pty. git • git clone git: //github. com/paddybyers/node. git
Anode Build • Set up the NODE_ROOT variable to point to the top-level node directory of that repo.
Anode Build • Build the native code • cd anode ndk-build NDK_PROJECT_PATH=. NDK_APPLICATION_MK=Application. mk • cp libs/armeabi/libjninode. so. /app/assets/ • cp libs/armeabi/bridge. node. /app/assets/
Anode Build • Set up the Eclipse Android projects • Open Eclipse and do: • File->Import->General->Existing projects into workspace • Point to the <work dir>/anode directory and import the app, libnode and bridge-javaprojects.
Java Bridge • Anode includes a bridge to a java runtime, so that modules can be written (and, ultimately, dynamically deployed) as Java libraries. • The bridge is still under development. This means that the features described in these notes may be unimplemented, or not stable, and are also liable to change.