- 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 - Architecture
SL4A has three main components. They are as follows −
- Script Interpreters
- Android RPC Client
In this chapter, we will discuss more about these three components.
Each script runs in its own interpreter instance. Hence, multiple scripts can run simultaneously without affecting each other.
Android RPC Client
Scripts running within the interpreter instance communicates with the SL4A application through the Android Proxy RPC Client. The client establishes a Remote Procedure Call (RPC) connection to SL4A, and allows scripts to interact with the Android Framework. The SL4A facades facilitate this communication. Data is sent as JSON payloads.
Android RPC clients are provided for every supported scripting language. The client modules can be obtained from the SL4A website at https://code.google.com.
The façade simplifies the script’s access to the underlying Android API. SL4A exposes the Android Framework API to scripts through an extensive set of facades like AndroidFacade, BluetoothFacade, ActivityManagerFacade, CommonIntentsFacade, etc.
SL4A functionality offers a basket of rich functionalities like Camera, Location, Battery Manager, Media Player, Media Recorder and many more.
The SL4A system is suited for the following kinds of tasks −
RAD programming − With SL4A, it is possible to use Rapid Application Development (RAD) approach to create a prototype application quickly. You can create a full-blown Android application if the feasibility of the idea is confirmed.
Test scripts − It can be used to write test scripts.
Building Utilities − Utility scripts or tools that perform small tasks or automate certain aspects of repetitive tasks can be built using SL4A.
Kickstart Your Career
Get certified by completing the courseGet Started