mwiemarc / node-android

Run Node.js on Android by rewrite Node.js in Java

Home Page:https://instantwebp2p.github.io/node-android/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

node-android

Run Node.js on Android by rewrite Node.js in Java with the compatible API.

third-party: libuvpp, libuv-java JNI code by Oracle.

Build

Clone the code, open Android Studio (1.*) and import the project.

For Eclipse ADT user, refer to https://github.com/InstantWebP2P/node-android/tree/adt

Javascript code injection

> adb shell am start -a android.intent.action.VIEW -n com.iwebpp.nodeandroid/.MainActivity -e js "var run = function () { return 'hello world'; } run();"

Features

JS runtime

  • Rhino supported
  • Exposed node-android packages: com.iwebpp.node.http, com.iwebpp.node.stream, com.iwebpp.node.net, etc
  • Exposed node-android classes: com.iwebpp.node.EventEmitter2, com.iwebpp.node.Dns, com.iwebpp.node.Url, etc
  • Exposed node-android native context in JS standard scope as NodeCurrentContext alias NCC
  • Exposed Android API: android.util.Log
  • NodeJS compatible internal modules are available in JS standard scope
  • Exposed WebSocket classes: com.iwebpp.wspp.WebSocket, com.iwebpp.wspp.WebSocketServer

JS usage

TODO

  • API doc, more demos
  • JS runtime CommonJS/AMD compliance

### License

(see LICENSE file)

Copyright (c) 2014-2016 Tom Zhou(iwebpp@gmail.com)

About

Run Node.js on Android by rewrite Node.js in Java

https://instantwebp2p.github.io/node-android/

License:Other


Languages

Language:Java 75.8%Language:C 12.5%Language:C++ 11.7%Language:Makefile 0.1%