- SL4A - Packaging & Distributing
- SL4A - Background Script with Python
- SL4A - Utilities using Python Facades
- SL4A - Building GUIs
- SL4A - Exploring Android API
- SL4A - Working with Eclipse
- SL4A - Navigating the Android SDK
- SL4A - Configuring Your Device
- SL4A - Development Environment
- SL4A - Python Library
- SL4A - Architecture
- SL4A - Scripting Layer for Android
- SL4A - Android Architecture
- SL4A - Android Overview
- SL4A - Home
SL4A Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
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 pbrary 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 pght 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
Python
Rhino 1.7R2
Javascript
TCL
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 apppcation 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.
![Python Targeting SL4A](/sl4a/images/python_targeting_sl4a.jpg)