Skip to content

Instantly share code, notes, and snippets.

@hns
Created February 22, 2012 20:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hns/1887178 to your computer and use it in GitHub Desktop.
Save hns/1887178 to your computer and use it in GitHub Desktop.
Native Android activity written in JavaScript
# compile step for js activity - yes, this will be automated!
java -cp libs/js.jar:../android-sdk-linux/platforms/android-15/android.jar org.mozilla.javascript.tools.jsc.Main -o JsActivity -package org.jsdroid.demo -d out/production/jsdroid-demo/ -version 180 -extends android.app.Activity src/org/jsdroid/demo/JsActivity.js
var {TextView} = Packages.android.widget;
function onCreate(savedState) {
this.super$onCreate(savedState);
var view = new TextView(this);
view.text = "Android ♥ Rhino";
this.contentView = view;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment