/droidscript

JavaScript for Android

Primary LanguageJava

Copyright (c) 2009-2010 Mikael Kindborg mikael.kindborg@gmail.com
Source code license: MIT

DroidScript - JavaScript for Android! :-)

The project is experimental!

DroidScript (formerly called RhinoDroid) is a JavaScript programming tool for Android.
It is a tool for building full Android applications.

It is based on the Mozilla Rhino JavaScript implementation (which is why it was first 
called RhinoDroid).

The DroidScript application allows both editing and running programs on a device, 
and will add remote coding using a web application. The application contains a tiny 
web server that accepts HTTP PUT-requests with JavaScript code as its body.

At http://droidscript.se there is a live editor you can use to interactively author
and experiment with JavaScript on a device or on the emulator.

To-do list:
- More stable error handling -> Improved! Now errors are catched more 
  roubustly and notifications are used to display JavaScript errors.
- Better on-the-device editing capabilities (text editor with
  more traditional text selection & copy/paste, plus fixing
  the scroll thumb so that it displays properly; virtual keyboard
  also needs fixing so that it doesn't overlap the edit view)
- Being able to save scripts on the device
- Better support for browsing scripts
- Support for implementing Java interfaces in JavaScript
  (in Rhino this relies on byte code generation, which does
  not yet work on Dalvik, meanwhile use Proxy)
- Support for subclassing Java classes, will require byte code
  generation for Dalvik
- Write more blog posts with example code
- Write a book on how to program Android using JavaScript

How To Get Started

The quick-start is to go to http://droidscript.se and follow instructions 
on the web page. 

There is  a blog at http://droidscript.blogspot.com that has updates and posts
related to DroidScript. Here you will find download information.

On startup, the app reads a JavaScript file: 
/sdcard/droidscript/DroidScriptApp.js

If not present, DroidScriptApp.js, DroidScriptServer.js and a number of
additional script files are downloaded from GitHub when the app starts.

How To Get Started With Development

Grab the project from GitHub.

Import project into Eclipse (or use the editor/development tool of choice).

Steps if using the emulator:
1) Create an SD card image with: mksdcard 512M sdcard.iso
2) Launch emulator with the shell script: ./emulator.sh

Copy the app to the device/emulator with shell script: ./install.sh

Copy JavaScript files to device/emulator with shell script: ./copyjs.sh

Have fun!

Big thanks to the Mozilla Rhino developers, Brice Lambson for putting Rhino
on Android, and to Marijn Haverbeke, developer of the CodeMirror editor.

Best regards, Mikael Kindborg (^_^)