Showing posts with label sl4a. Show all posts
Showing posts with label sl4a. Show all posts

Monday, September 12, 2011

SL4A:The Scripting Layer for Android

SL4A enables it to support many scripting language
interpreters. In order to make practical use of SL4A, we will need atleast
the rudiments of one high-level scripting language such as Python, Ruby, Perl, Lua,
JavaScript, or BeanShell.

For me it meant ability to create and run python scripts on my phone without having to ROOT the phone. It makes possible to use lots of GUI like Checkboxes, Radio buttons, Inputbox very easily. I checked out some sample scripts and they were small and simple scripts just like normal python.

For ex. only 4 lines code was able to speak time using text-to-speech engine. Mind it two lines of them were import statements :D

import android
import time

droid = android.Android()
droid.ttsSpeak(time.strftime("%_I %M %p on %A, %B %_e, %Y "))



I found out about python scripting on android after months of buying the android phone :D
I feel ashamed of myself for not finding out this long ago. Well there were some battery problems with phone so had to give it back to service center two times. But it feels great now.

Better than that it allows directly creating & editing the scripts directly on phone also :-D

So I would be starting some scripting on python. If done anything interesting I will post it.