GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - InstantWebP2P/node-android: Run Node.js on Android by rewrite Node.js in Java

BranchesTags
Open more actions menu

Latest commit

 

History

296 Commits
296 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
app
app
 
 
gradle/wrapper
gradle/wrapper
 
 
libs
libs
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
import-summary.txt
import-summary.txt
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

node-android

Android CI

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 ADT branch

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

  • Node.js 0.10.x compatible API by rewrite NodeJS in Java
  • Multi-threading: run separate node context in Java thread
  • libUV native support
  • Timer, set/clear Timeout/Interval
  • EventEmitter
  • Stream
  • HttpParser - Rewrite Http-parser.c in java
  • HTTP
  • HTTPP - Run Http over Udp
  • TCP
  • UDT - Udp Transport
  • DNS
  • URL
  • IPv6
  • NodeJS alike API
  • WebSocket, WebSocketServer
  • Connect middleware
  • Crypto: NaCL support, public box,secret box,signature/verify
  • SecureWebSocket over NaCL
  • NaCL Cert

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

  • In case Rhino, create class 'MyScript' extends from com.iwebpp.node.js.rhino.Host
  • Implement 'public String content()' in 'MyScript' to return user script
  • Execute JS engine in a separate Java Thread with 'MyScript.execute()'
  • When authoring script, please use NodeCurrentContext(alias NCC) in node-android API
  • JS API usages details

TODO

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

Support us

  • Welcome contributing on document, codes, tests and issues

### License

(see LICENSE file)

Copyright (c) 2014-present Tom Zhou([email protected])

About

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

instantwebp2p.github.io/node-android/

Topics

andriodhttppjavanode-androidnodejsp2pp2p-httprhinoudt

Resources

Readme
License
Activity
Custom properties

Stars

636 stars

Watchers

31 watching

Forks

62 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.