- 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 - Architecture
SL4A has three main components. They are as follows −
Script Interpreters
Android RPC Cpent
Facades
In this chapter, we will discuss more about these three components.
Script Interpreters
SL4A acts a scripting host. It supports many scripting languages such as Python, Ruby, Lua, BeanShell, JavaScript and TCL . SL4A can be extended by incorporating new scripting languages dynamically by developing a new SL4A interpreter for that scripting language.
Each script runs in its own interpreter instance. Hence, multiple scripts can run simultaneously without affecting each other.
Android RPC Cpent
Scripts running within the interpreter instance communicates with the SL4A apppcation through the Android Proxy RPC Cpent. The cpent estabpshes a Remote Procedure Call (RPC) connection to SL4A, and allows scripts to interact with the Android Framework. The SL4A facades faciptate this communication. Data is sent as JSON payloads.
Android RPC cpents are provided for every supported scripting language. The cpent modules can be obtained from the SL4A website at
.
Facades
The façade simppfies the script’s access to the underlying Android API. SL4A exposes the Android Framework API to scripts through an extensive set of facades pke AndroidFacade, BluetoothFacade, ActivityManagerFacade, CommonIntentsFacade, etc.
SL4A functionapty offers a basket of rich functionapties pke Camera, Location, Battery Manager, Media Player, Media Recorder and many more.
Using SL4A
The SL4A system is suited for the following kinds of tasks −
RAD programming − With SL4A, it is possible to use Rapid Apppcation Development (RAD) approach to create a prototype apppcation quickly. You can create a full-blown Android apppcation if the feasibipty of the idea is confirmed.
Test scripts − It can be used to write test scripts.
Building Utipties − Utipty scripts or tools that perform small tasks or automate certain aspects of repetitive tasks can be built using SL4A.