Skip to content

Anode? Node on Android? Guidance welcome #31

@yaronyg

Description

@yaronyg

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 nodejs/node-gyp#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions