Skip to content

jonasbeckman/RhinoDroid

Repository files navigation

INFO

Experimental "web server" that acceps PUT-requests with JavaScript code as content.
The server evaluates the JavaScript code using the Rhino engine.
Copyright (c) 2009 Mikael Kindborg mikael.kindborg@gmail.com
Licence: MIT

HOW TO INSTALL

First modify local.properties to point to your Android SDK, alter this line:
sdk.dir=/Users/miki/android/android-sdk-mac

Then compile and upload to emulator/device. 

Either use the command line:

- ant install

Or use Eclipse:

- File->New Project->Other->Android->Create project from existing source
- Browse to where you downloaded the source and click through the wizard
- Open project properties and add /libs/rhino_7R2.jar to build path
- Right-click on project and select run Debug as->Android project
- Wait for the emulator to come up 

HOW TO RUN THE JAVASCRIPT SERVER

1) First make sure the RhinoDroidServer is really running on the emulator
2) Create a port forwarding using the commands found at the start of the file 
squeak/Android Workspace.text. It should look like this (port numbers might be different):

telnet localhost 5554
redir add tcp:4042:4042
quit

Run this from your ordinary command line. You now have a server that can execute Javascript.

To evaluate code, you must send it to the device using an HTP PUT request.
In your "pharo" folder there is a Smalltalk workspace to do this. Proceed as follows:

3. Download Pharo from: http://www.pharo-project.org/pharo-download
4. Install Pharo and open the Pharo image file
5. Click on the background, from the popup-menu select Tools->File Browser
6. Browse to the file "/pharo/Android-Workspace.st", select it and click "Filein"
7. Now click on the background, from the popup-menu select "Workspace"
8. Type: AndroidWorkspace new open
9. Select this text with your mouse, right-click it and from the popup-menu choose "do it"
10. A new windows opens where you can type in JavaScript code and run it!

Select any text you wish to evaluate, right-click it and from the popup-menu choose "Run on Android"

Have fun!

Micke (^_^)

About

Rhino (JavaScript) on Android

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published