- SL4A Tutorial
- SL4A - Home
- SL4A - Android Overview
- SL4A - Android Architecture
- SL4A - Scripting Layer for Android
- SL4A - Architecture
- SL4A - Python Library
- SL4A - Development Environment
- SL4A - Configuring Your Device
- SL4A - Navigating the Android SDK
- SL4A - Working with Eclipse
- SL4A - Exploring Android API
- SL4A - Building GUIs
- SL4A - Utilities using Python Facades
- SL4A - Background Script with Python
- SL4A - Packaging & Distributing
SL4A - Scripting Layer for Android
Android scripting is a handy tool for simple tasks such as automation and prototyping as against using the Java programming language for the same. The Scripting Layer for Android (SL4A) provides a platform for multiple scripting solutions on the android platform.
What is SL4A?
The Scripting Layer for Android (SL4A) is a library that provides a platform to write simple scripts to automate tasks on an android device using languages other than JAVA.
SL4A, originally called Android Scripting Environment (ASE), was first announced on the Google Open Source blog in June 2009. The project saw the light of the day primarily through the efforts of Damon Kohler and it has grown through the contributions of other developers.
It supports most popular scripting languages. These include −
- Beanshell 2.0b4
- JRuby 1.4
- Lua 5.1.4
- Perl 5.10.1
- PHP 5.3.3
- Rhino 1.7R2
Why SL4A – Scripting Languages Vs JAVA
One of the first questions one would probably ask is, “Why use SL4A instead of Java?”
Firstly, not everyone is a fan of Java. Scripting languages provide an easy programming environment as compared to Java.
Secondly, the language requires the use of an edit/compile/run design loop. This means that you edit, re-compile and then run the application each time you desire some modification. On the contrary, scripts are interpreted and executed on the fly. Moreover, SL4A even makes it possible, in many cases, to reuse code written for a desktop environment.
The following figure illustrates scripts written in Python targeting SL4A and in Java respectively.
Kickstart Your Career
Get certified by completing the courseGet Started