Sunday, 4 August 2013

How To Provide Python Support For Android Using SL4A (Scripting Layer For Android)

python for android

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.
Scripts can be run interactively in a terminal or in the background,. Python, Perl, JRuby, Lua, BeanShell, JavaScript, Tcl, and shell are currently supported, and more languages support will be added soon. 

NOTE: For Rooted Devices Only

  • Rooted Android Device
  • Android Terminal Emulator
  • SL4A
  • PythonForAndroid 

1- Download SL4A and PythonForAndroid:

Download: SL4A
Download: Python For Android

2- Install SL4A and PythonForAndroid by granting superuser permissions.
3- After successful installation, SL4A will look like this.(forget the weevely folder, it doesn't come with SL4A installation)

SL4A android scripting layer

 4- And successfully installed Python For Android will look like this:

python for android using SL4A

5- Now install Android Terminal Emulator from the following Google Play's link:

Download: Android Terminal Emulator

6- Open terminal and type su and press enter to enter in super user or "sudo" mode. 
7- Now type python and press enter. You will get inside python interpreter. 
Now execute your python statements and enjoy.

Visit Official Site For further details