Coder Social home page Coder Social logo

node-android's Introduction

node-android

============

An Android port of node.js. Tested with NDK r9d.

Build native node.js

============

  • Run "git pull --recurse-submodules" to make sure you have all sources in local
  • Clone the latest node.js into jni/node-latest
  • Switch directory to jni/
  • Run "build-node <NDK_PATH>"
  • Run "ndk-build"

Build demo package

============ You could build demo package with "ant debug"

node-android's People

Contributors

aral avatar julianshen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

node-android's Issues

ndk-build的时候出错

[armeabi] Compile++ thumb: nodeJNI <= node_jni.cc
[armeabi] SharedLibrary : libnodeJNI.so
/media/cherokee/project/android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /media/cherokee/project/project/node-android/jni/node-latest/libnode.a(cares_wrap.o): in function node::cares_wrap::IsIP(v8::FunctionCallbackInfov8::Value const&):cares_wrap.cc(.text._ZN4node10cares_wrapL4IsIPERKN2v820FunctionCallbackInfoINS1_5ValueEEE+0x58): error: undefined reference to 'node::Utf8Value::Utf8Value(v8::Handlev8::Value)'
/media/cherokee/project/android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /media/cherokee/project/project/node-android/jni/node-latest/libnode.a(cares_wrap.o): in function node::cares_wrap::SetServers(v8::FunctionCallbackInfov8::Value const&):cares_wrap.cc(.text._ZN4node10cares_wrapL10SetServersERKN2v820FunctionCallbackInfoINS1_5ValueEEE+0x1ac): error: undefined reference to 'node::Utf8Value::Utf8Value(v8::Handlev8::Value)'
/media/cherokee/project/android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /media/cherokee/project/project/node-android/jni/node-latest/libnode.a(cares_wrap.o): in function void node::cares_wrap::Querynode::cares_wrap::QueryAWrap(v8::FunctionCallbackInfov8::Value const&):cares_wrap.cc(.text._ZN4node10cares_wrapL5QueryINS0_10QueryAWrapEEEvRKN2v820FunctionCallbackInfoINS3_5ValueEEE+0x150): error: undefined reference to 'node::Utf8Value::Utf8Value(v8::Handlev8::Value)'
/media/cherokee/project/android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /media/cherokee/project/project/node-android/jni/node-latest/libnode.a(cares_wrap.o): in function void node::cares_wrap::Querynode::cares_wrap::GetHostByAddrWrap(v8::FunctionCallbackInfov8::Value const&):cares_wrap.cc(.text._ZN4node10cares_wrapL5QueryINS0_17GetHostByAddrWrapEEEvRKN2v820FunctionCallbackInfoINS3_5ValueEEE+0x150): error: undefined reference to 'node::Utf8Value::Utf8Value(v8::Handlev8::Value)'
collect2: ld returned 1 exit status
make: *** [/media/cherokee/project/project/node-android/obj/local/armeabi/libnodeJNI.so] Error 1

这个会是什么原因引起的呢?

ImportError: No module named bz2

File "../../tools/js2c.py", line 37, in
import bz2
ImportError: No module named bz2
make[1]: *** [/node-android/jni/node-latest/out/Release/obj/gen/libraries.cc] Error 1
make[1]: Leaving directory `/node-android/jni/node-latest/out'
make: *** [node] Error 2
../.android-toolchain/bin/arm-linux-androideabi-ar: out/Release/obj.target/node/src/cares_wrap.o: No such file or directory

ndk-build error

/node-android/jni# ndk-build
[armeabi] SharedLibrary : libnodeJNI.so
/webdisk/opt/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /webdisk/kortide/node-android/jni/node-latest/libnode.a(cares_wrap.o): in function node::cares_wrap::IsIP(v8::FunctionCallbackInfov8::Value const&):cares_wrap.cc(.text._ZN4node10cares_wrapL4IsIPERKN2v820FunctionCallbackInfoINS1_5ValueEEE+0x58): error: undefined reference to 'node::Utf8Value::Utf8Value(v8::Handlev8::Value)'
/webdisk/opt/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /webdisk/kortide/node-android/jni/node-latest/libnode.a(cares_wrap.o): in function node::cares_wrap::SetServers(v8::FunctionCallbackInfov8::Value const&):cares_wrap.cc(.text._ZN4node10cares_wrapL10SetServersERKN2v820FunctionCallbackInfoINS1_5ValueEEE+0x1ac): error: undefined reference to 'node::Utf8Value::Utf8Value(v8::Handlev8::Value)'
/webdisk/opt/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /webdisk/kortide/node-android/jni/node-latest/libnode.a(cares_wrap.o): in function void node::cares_wrap::Querynode::cares_wrap::QueryAWrap(v8::FunctionCallbackInfov8::Value const&):cares_wrap.cc(.text._ZN4node10cares_wrapL5QueryINS0_10QueryAWrapEEEvRKN2v820FunctionCallbackInfoINS3_5ValueEEE+0x144): error: undefined reference to 'node::Utf8Value::Utf8Value(v8::Handlev8::Value)'
/webdisk/opt/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /webdisk/kortide/node-android/jni/node-latest/libnode.a(cares_wrap.o): in function void node::cares_wrap::Querynode::cares_wrap::GetHostByAddrWrap(v8::FunctionCallbackInfov8::Value const&):cares_wrap.cc(.text._ZN4node10cares_wrapL5QueryINS0_17GetHostByAddrWrapEEEvRKN2v820FunctionCallbackInfoINS3_5ValueEEE+0x144): error: undefined reference to 'node::Utf8Value::Utf8Value(v8::Handlev8::Value)'
collect2: ld returned 1 exit status
make: *** [/node-android/obj/local/armeabi/libnodeJNI.so] Error 1

Documentation

Hi
Saw your comment here paddybyers/anode#28 (comment) but the repo mentioned has no issues tab so I am logging here.
This is interesting alright but any chance of some docs on getting the demo up and running without ant? or more info on howto install ant?

Maybe assume NDK and android SDK but ant is too much friction for node devs.

Also what are the issues with JNI and how does that impact?

My thoughts were on having node run as a seperate process on the phone and instead of running all the native interop magic just run it as a seperate service/process and communicate to it over tcp or pipes?

Thanks again for flagging this project to me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.