BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Android Gets Scripting Support with Python, Lua, Beanshell; Ruby planned

Android Gets Scripting Support with Python, Lua, Beanshell; Ruby planned

This item in japanese

The Android Scripting Environment (ASE) add scripting capabilities to Android devices. By installing the ASE, it's possible to write scripts on the device and execute them.

While there are many tools to help with developing Android apps, writing scripts straight on the device allows quick experimentation and prototyping directly on the device, without having to load up the IDE, compile, deploy etc.

The ASE uses two approaches to access Android APIs. Currently, Python and Lua runtimes can be used to run scripts using ASE. These runtimes are native applications, and they access the APIs via JSON RPC.

As Android's based on Java, there's also the option of running JVM languages. Currently, BeanShell, a dynamic version of the Java language, is available. The JVM-based interpreters are simply launched inside ASE, and don't need the indirection of the RPC calls.
The ASE adds a new incentive to get more JVM Languages to work on Android. While JRuby has initial support for running on Android, there remain problems. One issue is Android's use of the Dalvik VM (Android apps are compiled into Dalvik VM bytecodes).

A look at the SVN repository of ASE shows the first signs of JSON RPC based Ruby support.

Another way to use Ruby on Android devices is Rhodes.

It'll be interesting to see how ASE continues to develop. Unlike the iPhone, which doesn't permit applications that bring interpreters to the platform, with ASE, Android devices can now be extended with scripts, which can be created and edited by the user.

Rate this Article

Adoption
Style

BT