Scripting Layer for Android (SL4A) brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreters directly on the Android device. These scripts have access to many of the APIs available to full-fledged Android applications, but with a greatly simplified interface that makes it easy to get things done.
SL4A is designed for developers and is alpha quality software. Please report bugs and feature requests on the issues list.
You can download the current APK by scanning or clicking the following barcode:
- Even though a lot of contributors are working for Google, this is not an official Google product.
- SL4A is no longer under active development. However, some forks of this project may be.
The original Google Code wiki has been converted to Markdown and is available in the docs folder. A few of the most important pages are:
- User Guide
- API Reference
- Tutorials ... it is a little old but useful for start.
- damonkholer documents archive from googlecode ... please report if you find the document that is not here.
I ignored the issues in google-code, because it's not controllable. New issues will be accepted from issue page.
<wiki:gadget url="http://www.ohloh.net/p/346315/widgets/project_users_logo.xml" height="43" border="0" />
To install SL4A, you will need to enable the "Unknown sources" option in your device's "Application" settings.
Still have questions? Check out the FAQ.
Support for SL4A is provided by the community on the project mailing list.
Want to learn more?
Start by reading "Introducing SL4A: The Scripting Layer for Android" by Pieter Greyling and "Packaging and Distributing" by Paul Ferrill.
These are the intellectual property of Apress and are excerpt from the books "Practical Android Projects" and "Pro Android Python with SL4A."
Apress is happy to provide 25% off the price of the "Practical Android Projects" eBook. Simply enter the special code "SL4APROJECTROCKSHLDD" upon checkout when purchasing the eBook here. Offer expires 12/30/11.
You can buy "Pro Android Python with SL4A" directly from Apress.
Apress is also happy to provide 25% off the price of the "Pro Android Python with SL4A" eBook. Simply enter the special code "THESL4APROJECTROCKS" upon checkout when purchasing the eBook here. Offer expires 12/30/11.
What's Powered by SL4A?
Want to see SL4A in action? Check out some of these cool SL4A powered projects:
SL4A was used by the Nexus One payload for sensor logging. See the article in Make for more information about the project.
We are a collection of hobbyists who want to free your cell phone from your pocket and let it connect and move with the real world. How? As a robot of course!
Cellbots aren't just about using your phone to control a robot (which is cool too), but we aim on making your phone be the robot.
It already has touch, hearing, speech, vibration, and many more senses, but needs legs (or wheels) to finally be the free roaming robot it was born to be.
Using a single master password and various account names, one can create an infinite number of unique account passwords.
These unique account passwords are commonly called password hashes, domain-specific passwords, or per-site passwords.
See the Oplop project page for more information.
Broadcast is an embedded web application for remote Android device management. Broadcast has four goals:
- Remote monitoring: Make Android state and device data available over a network.
- Remote control: Allow remote control of an Android device over a network.
- Proof-of-concept: Demonstrate that complex ruby applications can run in an Android environment, even with constrained resources.
- Framework: Set the groundwork for a number of advanced applications.
SMS Merger is an excellent example of what can be done with Python and the WebView API. SMS Merger is designed to send a series of personalized SMS. For example, to let Antony, Bob and Claire know which seat number they have been allocated for their exams, SMS Merger can turn a CSV file into the following SMS messages:
Dear Antony, your seat is A1 Dear Bob, your seat is M4 Dear Claire, your seat is M2
Have a project you'd like to see listed here? Tell us about it on the mailing list.
- Clone this project, and type below in your terminal:
$ cd android/ScriptingLayerForAndroid $ echo sdk.dir=/path/to/android-sdk > local.properties $ sh /path/to/android-stdudio/gradle/gradle-2.2.1/bin/gradle assembleDebug Building ??% ... $ ls build/outputs/apk/ ScriptingLayerForAndroid-arm-debug.apk
Please replace /path/to strings to your environment or installed place.
- Connect you phone or launch a virtual machine, then send the apk to them:
$ /path/to/android-sdk/platform-tools/adb install build/outputs/apk/ScriptingLayerForAndroid-arm-debug.apk
- Install the interpreters apk in Android. (each interpreters is not build yet.)
- Enjoy scripting!
- Clone this project, and import it into Android stdudio.
- Select "Import project"
- Select the folder: cloned/project/android/Scriptinglayerforandroid
- Configure the gradle path: /path/to/android-stdudio/gradle/gradle-2.2.1
- Configure the android sdk path.
After Android Studio launch,
- Select the menu: "Build" >> "Build Module"
- Select the menu: "Run" >> "Run"
- Connect your phone or launch a virtual machine, compiled apk will be installed.
Clone this project, and import it into Eclipse. Make sure that the Java compliance level is at 1.6 (right-click any project, go to Properties > Java Compiler > Configure Workspace Settings and select 1.6.
Make sure that you have all the appropriate Android SDKs installed through Eclipse. You can determine this by looking at what errors prop up.
Make sure the environment variable ANDROID_SDK is set, by going to Window > Preferences > Java > Build Path > Classpath Variables and creating a new variable ANDROID_SDK that points to the android-sdks folder.
Make sure you clean all projects by going to Project > Clean.
If there are still issues, look at this to find tidbits you could possibly do: http://jokar-johnk.blogspot.co.nz/2011/02/how-to-make-android-app-with-sl4a.html
Languages are shipped with Android application. (but not maintainanced well except of python.)
- USBHostSerialFacade: for USB Serial devices