Android framework for node.js applications

Related tags

Miscellaneous anode
Overview

Introduction

Anode is an embryonic framework for running node.js applications on Android. There are two main parts to this:

  • a port of node.js to the Android OS and libraries. The code is here;

  • a set of Android projects (this repo) that provide the integration with the Android frameworks.

Anode builds to an Android application package (.apk) that encapsulates the node.js runtime and can run node.js applications through an intent-based API.

Status

This work is at an early stage. All input is welcome.

The current target is to support node.js applications, invoked by intent. Multiple instances can be run in parallel. Modules (or addons) for node.js written in JavaScript or native are supported, and support for modules implemented in Java is on the roadmap.

This framework depends on a port of node here.

More information

Please see the wiki for more information.

Comments
  • build failed on mac osx 10.7

    build failed on mac osx 10.7

    OS : mac osx 10.7 xcode: 4.2 openssl: 1.0.0e

    I follow the build instructions in wiki https://github.com/paddybyers/anode/wiki/Build

    But it could not work for me.First, If i set NDK_MODULE_PATH as you say

    export NDK_MODULE_PATH=/anode:/anode/anode

    Then ndk-build failed with message

    Android NDK: /Users/apple/programming/js/node-js/anode/anode/libnode/jni/Android.mk: Cannot find module with tag 'deps/c-ares' in import path
    Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
    Android NDK: The following directories were searched:
    Android NDK:
    /Users/apple/programming/js/node-js/anode/anode/libnode/jni/Android.mk:42: *** Android NDK: Aborting. . Stop.

    Then ,i changed NDK_MODULE_PATH to

    export NDK_MODULE_PATH=/anode:/anode/anode:/anode/node

    Then ndk-build failed again,but with message

    Compile++ thumb : node <= node.cc In file included from /Users/apple/programming/js/node-js/anode//node/src/node.cc:76: /Users/apple/programming/js/node-js/anode//node/src/node_crypto.h:29:25: error: openssl/ssl.h: No such file or directory /Users/apple/programming/js/node-js/anode//node/src/node_crypto.h:30:25: error: openssl/err.h: No such file or directory /Users/apple/programming/js/node-js/anode//node/src/node_crypto.h:31:25: error: openssl/evp.h: No such file or directory /Users/apple/programming/js/node-js/anode//node/src/node_crypto.h:32:25: error: openssl/pem.h: No such file or directory /Users/apple/programming/js/node-js/anode//node/src/node_crypto.h:33:26: error: openssl/x509.h: No such file or directory /Users/apple/programming/js/node-js/anode//node/src/node_crypto.h:34:26: error: openssl/hmac.h: No such file or directory

    But i have installed openssl on my mac machine,and openssl/ssl.h,openssl/err.h etc these files are already in /usr/include/openssl,why ndk-build can not find them?

    Can you help me?Thanks a lot.

    opened by cnlojure 18
  • Thread pooling not working in libuv, calling uv_run(uv_default_loop()) fixes

    Thread pooling not working in libuv, calling uv_run(uv_default_loop()) fixes

    When compiling node-sqlite3 for anode, db connections weren't being successfully opened. Investigating further, it seemed that the the "after" callback in uv_queue_work wasn't being called. Adding uv_run(uv_default_loop()) fixes both this test code and the sqlite code.

    This code shows the error:

    
    #include <node.h>
    #include <v8.h>
    #include <android/log.h>
    
    #define APPNAME "HELLOWORLD"
    
    using namespace v8;
    
    static int timesFinished = 0;
    
    void AsyncWork(uv_work_t* req) {
        __android_log_print(ANDROID_LOG_VERBOSE, APPNAME, "In Async Work");
        timesFinished++;
    }
    
    void AfterAsync(uv_work_t* req) {
        __android_log_print(ANDROID_LOG_VERBOSE, APPNAME, "Finished Async Work");
        timesFinished++;
    
        // be nice and clean up
        delete req;
        req = NULL;
    }
    
    Handle<Value> Method(const Arguments& args) {
      HandleScope scope;
    
      uv_work_t * req = new uv_work_t();
      int status = uv_queue_work(uv_default_loop(), req, AsyncWork, AfterAsync);
      __android_log_print(ANDROID_LOG_VERBOSE, APPNAME, "uv_queue_work status %d", status);
    
      // I Shouldn't have to call this... but calling it fixes this code AND SQLITE3
      uv_run(uv_default_loop());
    
      __android_log_print(ANDROID_LOG_VERBOSE, APPNAME, "work count should be 2 %d", timesFinished);
    
      return scope.Close(String::New("something worked"));
    }
    
    void init(Handle<Object> target) {
      target->Set(String::NewSymbol("test"), FunctionTemplate::New(Method)->GetFunction());
    }
    
    
    NODE_MODULE(asyncfail, init)
    

    It would appear that libuv's event loop (?) isn't being started, and this problem would be fixed by adding a call to uv_run(...) in the initialization somewhere.

    opened by skabbes 5
  • build bridge failed(no setExitHandler) on 'master-isolate-android'

    build bridge failed(no setExitHandler) on 'master-isolate-android'

    some errors came out when I checked out 'master-isolate-android' :

    $ ndk-build NDK_PROJECT_PATH=. NDK_APPLICATION_MK=Application.mk

    Install : libjninode.so => libs/armeabi/libjninode.so Compile++ thumb : bridge <= Env.cpp bridge/src/Env.cpp: In member function 'int bridge::Env::initV8()': bridge/src/Env.cpp:142:16: error: 'class node::Isolate' has no member named 'setExitHandler' make: *** [obj/local/armeabi/objs/bridge/src/Env.o] Error 1

    opened by karfield 2
  • Root Access For Native Modules

    Root Access For Native Modules

    Hi I see there is a requirement to put the addons into /data/data/org.meshpoint.anode/app/module/ This requires root access to the phone. Any idea when it will be resolved or a clue on what prevented the modules being placed on the SDCARD for example?

    Thanks and loved the talk @ LXJS BTW.

    opened by No9 2
  • Can not restart a node.js instance.

    Can not restart a node.js instance.

    Hi To start a node.js instance is ok, but stop and then restart it will always fail.

    The below is the logcat log. 01-13 23:52:47.909: V/libjninode(20777): Java_org_meshpoint_anode_RuntimeNative_create ent 01-13 23:52:47.909: V/libjninode(20777): Java_org_meshpoint_anode_RuntimeNative_create ret 01-13 23:52:47.909: V/anode::Isolate(20777): Isolate.run(): setting context 01-13 23:52:47.909: V/bridge-core(20777): Env::setupEnv(): ent 01-13 23:52:47.909: V/bridge-core(20777): Env::initThread(): ent 01-13 23:52:47.909: V/bridge-core(20777): Env::initThread(): ret 01-13 23:52:47.909: V/bridge-core(20777): Env::setupEnv(): ret 01-13 23:52:47.909: V/anode::Isolate(20777): Isolate.run(): set context 01-13 23:52:47.909: V/anode::Isolate(20777): stateState: state = 2 01-13 23:52:47.909: V/libjninode(20777): Java_org_meshpoint_anode_RuntimeNative_start: ent 01-13 23:52:47.909: V/libjninode(20777): getNativeArgs: ent 01-13 23:52:47.909: V/libjninode(20777): getNativeArgs: ret 2 01-13 23:52:48.349: V/libjninode(20777): Java_org_meshpoint_anode_RuntimeNative_start: ret 1 01-13 23:52:48.349: V/anode::Isolate(20777): stateState: state = 4 Did anyone experience this problem? Thank you.

    opened by JarshChen 1
  • UnsatisfiedLinkError when running node.js script

    UnsatisfiedLinkError when running node.js script

    I'd put together a very simple "Hello world" script to try out Anode with. It's really nothing more than a console.log( ), but it's crashing with:

    E/AndroidRuntime(19217): FATAL EXCEPTION: IntentService[:anode.AnodeService] E/AndroidRuntime(19217): java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1306]: 144 cannot locate 'SSLv2_method'... E/AndroidRuntime(19217): E/AndroidRuntime(19217): at java.lang.Runtime.load(Runtime.java:340) E/AndroidRuntime(19217): at java.lang.System.load(System.java:524) E/AndroidRuntime(19217): at org.meshpoint.anode.RuntimeNative.init(RuntimeNative.java:61) E/AndroidRuntime(19217): at org.meshpoint.anode.Runtime.(Runtime.java:116) E/AndroidRuntime(19217): at org.meshpoint.anode.Runtime.initRuntime(Runtime.java:49) E/AndroidRuntime(19217): at org.meshpoint.anode.AnodeService.initRuntime(AnodeService.java:86) E/AndroidRuntime(19217): at org.meshpoint.anode.AnodeService.onHandleIntent(AnodeService.java:105) E/AndroidRuntime(19217): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) E/AndroidRuntime(19217): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(19217): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime(19217): at android.os.HandlerThread.run(HandlerThread.java:60)

    Did OpenSSL change out from under you, perhaps?

    opened by roadriverrail 1
  • TarExtractor and directories

    TarExtractor and directories

    this fix should handle directories better. i attempted a workaround for GNU tar files with long filenames, but it does not always work. this requires jtar-2.2 or later because the package name changed and older versions dont support ustar format, needed for long filenames.

    cheers

    opened by feichh 1
  • Allow a dynamic NODE_PATH

    Allow a dynamic NODE_PATH

    Enable third party developers to use their own package namespace when using anode. This is essential if you want anyone to publish applications under a namespace other than org.meshpoint.anode

    opened by skabbes 1
  • Add missing jtar library and resolve build error

    Add missing jtar library and resolve build error

    I added missing jtar library to /app/contrib folder. Also, I updated the library version from 1.0.4 to 2.2. Accordingly, the package name to refer jtar library is also changed in TarExtractor.java.

    opened by handk85 0
  • Add dynamic classloading for java module implementations

    Add dynamic classloading for java module implementations

    In addition to classes will now be loaded from a ModuleClassLoader implementation. The current implementation load classes from a predefined installed package.

    opened by pmorau 0
  • gitignore and JRE < 6 support

    gitignore and JRE < 6 support

    Added some small changes to support older JRE's (String.isEmpty isn't supported). Also, just trying out a simple commit to get familiar with github's fork / pull model.

    opened by skabbes 0
  • Anode? Node on Android? Guidance welcome

    Anode? Node on Android? Guidance welcome

    As mentioned in #28 it is now reasonably easy to build Android for Node (my own flavor of instructions are at http://www.goland.org/nodejsonandroid/). Now, it's not all fun and games. There are still basic things I'm trying to figure out such as https://github.com/TooTallNate/node-gyp/issues/515. But it looks like you can get there from here.

    The project I'm working on (http://www.thaliproject.org) wants to create a run time environment that uses HTML5 as the front end and node.js on the back end and runs on Android, iOS, Windows Desktop, Windows Runtime (read: store apps and phone) as well as Mac and Linux. Yes, this does smell a little bit like node-webkit but we explicitly don't want the HTML 5 front end and the Node.JS code to be tightly bound. We are very happy with a model in which HTML5 runs in a browser or web view and the Node.js code runs in a completely separate process/thread that has its own life cycle. We need this because in places like mobile we want the node.js program to hang out forever (only really feasible today with Android) receiving requests and handling them. In our case we are using node.js to house PouchDB and handle synching data in our peer to peer web.

    Which, finally, brings me to anode. I'm trying to figure out how to think about anode. I think our needs are actually less ambitious than anode. We would be perfectly happy just starting up a node.js process and letting it go. If the HTML 5 front end needs to talk to the node.js process then we are happy to do that over a localhost http connection. We even have a simple plan to use shared secrets to secure the connection so other apps on the same device can't sneak in.

    Given our goals is anode what we should be looking at? Or would we be better off just wrapping up node on Android with a nice little spawn event inside of a Java wrapper and calling it a day? [1]

    [1] And yes, I realize it won't be that easy. We'll need to handle life cycle events and surface them in node so it can gracefully shut itself off or know when there is no network connectivity. Our thinking is to expose these as standard events in node that would look the same on all of our platforms.

    opened by yaronyg 5
  • building error

    building error

    I followed as https://github.com/paddybyers/anode/wiki/build

    but i met a compile error as below:

    /home/david/NDKs/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ -MMD -MP -MF ./obj/local/armeabi/objs/bridge/src/Env.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -fno-rtti -mthumb -Os -g -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Ibridge/src -I./../node/src -I./../node/deps/v8/include -I./../node/deps/uv/include -I/home/david/NDKs/android-ndk-r9/sources/cxx-stl/system/include -Ibridge -DANDROID -D__POSIX__ -DBUILDING_NODE_EXTENSION -include sys/select.h -Wa,--noexecstack -Wformat -Werror=format-security -I/home/david/NDKs/android-ndk-r9/platforms/android-14/arch-arm/usr/include -c bridge/src/Env.cpp -o ./obj/local/armeabi/objs/bridge/src/Env.o bridge/src/Env.cpp: In member function 'int bridge::Env::initV8()': bridge/src/Env.cpp:142:16: error: 'class node::Isolate' has no member named 'setExitHandler'

    make: *** [obj/local/armeabi/objs/bridge/src/Env.o] Error 1

    Pls let me know what I shoud do.

    opened by shkim3000 0
  • Ports not being released on stop?

    Ports not being released on stop?

    Hi, It seems to me that the listening sockets are kept open after i stop an isolate, until I force stop the app through the app settings. This can cause EADDRINUSE errors, when a server is started again.

    cheers

    opened by feichh 1
  • AnodeActivity: An instance launched through activity is never removed from AnodeService

    AnodeActivity: An instance launched through activity is never removed from AnodeService

    Since AnodeActivity calls addInstance directly, when starting an isolate, it should also remove them, when they stop. The additional cleanup may be considered overkill, but i doubt it hurts.

    cheers

    opened by feichh 1
Owner
Paddy Byers
Paddy Byers
A simple and scalable Android bot emulation framework, as presented at Black Hat Europe's Arsenal

m3 A simple and scalable Android bot emulation framework. A detailed explanation can be found here. This project was first published at Black Hat Euro

null 22 Aug 20, 2022
A Java client for the Sixpack A/B testing framework https://github.com/seatgeek/sixpack

sixpack-java A Java client for SeatGeek's Sixpack a/b testing framework: https://github.com/seatgeek/sixpack Installing Sixpack-java is currently only

null 135 Oct 7, 2022
A RS3 RSPS framework targeted at NXT, the goal is to stay up-to-date with RS3

OpenNXT - RS3 919 A RS3 RSPS framework targeted at NXT, the goal is to stay up-to-date with RS3 Discord We have a Discord server you can join! https:/

Daniël Voort 23 Oct 13, 2022
JVM Bytecode Transformation Framework

unboks - JVM Bytecode Transformation Framework ⚠️ Read the State of the Project section before considering use! ⚠️ This framework exposes a graph-base

Anders Høst 1 May 25, 2022
♣️ A flexible and powerful command framework with default Guilded API implementations using deck

A simple and versatile command framework made with the primary objective of making Guilded command experience a little more elegant.

Gabriel 2 Dec 15, 2022
Starter-Android-Library - Starter Android Library is an Android Project with Modular Architecture.

Starter-Android-Library - Starter Android Library is an Android Project with Modular Architecture.

OpenBytes 1 Feb 18, 2022
SL4A brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreters directly on the Android device.

#Scripting Layer for Android (SL4A) SL4A brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreter

Damon Kohler 2.3k Dec 23, 2022
****. Use the native and support library variants instead - https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml.html. An android library that makes it easy to add custom fonts to edittexts and textviews

Add to your project Add this line to your dependencies in build.gradle compile 'in.workarounds.typography:typography:0.0.8' Using the views There are

Workarounds 43 Nov 6, 2021
ZXing ("Zebra Crossing") barcode scanning library for Java, Android

Project in Maintenance Mode Only The project is in maintenance mode, meaning, changes are driven by contributed patches. Only bug fixes and minor enha

ZXing Project 30.5k Dec 27, 2022
RxJava binding APIs for Android's UI widgets.

RxBinding RxJava binding APIs for Android UI widgets from the platform and support libraries. Download Platform bindings: implementation 'com.jakewhar

Jake Wharton 9.7k Jan 6, 2023
A gradle plugin for getting java lambda support in java 6, 7 and android

Gradle Retrolambda Plugin This plugin will automatically build your java or android project with retrolambda, giving you lambda goodness on java 6 or

Evan Tatarka 5.3k Jan 5, 2023
A comprehensive tutorial for Android Data Binding

精通 Android Data Binding 更多干货可移步至个人主页 QQ 交流群:324112728 ,或者点击链接加入QQ群 官方虽然已经给出了教程 - Data Binding Guide (中文版 - Data Binding(数据绑定)用户指南) ,但是实践之后发现槽点实在太多,于是就

Fei Liang 2.6k Dec 6, 2022
A Job Queue specifically written for Android to easily schedule jobs (tasks) that run in the background, improving UX and application stability.

Development in this repository is stopped. Future development continues on https://github.com/yigit/android-priority-jobqueue ========================

Path Mobile Inc Pte. Ltd. 2.4k Dec 9, 2022
An android library for displaying fps from the choreographer and percentage of time with two or more frames dropped

DEPRECATED TinyDancer is deprecated. No more development will be taking place. Check out the Google Android developer documentation for UI performance

Friendly Robot 1.9k Jan 3, 2023
Memory safer implementation of android.os.Handler

Android Weak Handler Memory safer implementation of android.os.Handler Problem Original implementation of Handler always keeps hard reference to handl

Badoo Tech 1.5k Jan 5, 2023
Android Library to help you with your runtime Permissions.

PermissionHelper Android Library to help you with your runtime Permissions. Demo Android M Watch it in action. Pre M Watch it in action. Nexus 6 (M) N

Kosh Sergani 1.2k Dec 14, 2022
Android validation library which helps developer boil down the tedious work to three easy steps.

AwesomeValidation Introduction Implement validation for Android within only 3 steps. Developers should focus on their awesome code, and let the librar

Jing Li 1.1k Dec 17, 2022
It makes a preview from an url, grabbing all the information such as title, relevant texts and images. This a version for Android of my web link preview https://github.com/LeonardoCardoso/Link-Preview

LeoCardz Link Preview for Android It makes a preview from an url, grabbing all the information such as title, relevant texts and images. Visual Exampl

Leonardo Cardoso 420 Nov 19, 2022
AndroidPermissions 4.2 0.0 Java Android M was added to check Permission. but Permission check processing is so dirty.

Android Permissions Checker Android M was added to check Permission. but Permission check processing is so dirty. This Project is to be simple, Checki

Steve SeongUg Jung 340 Nov 11, 2022