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.

2 comments:

Anonymous said...

very nice info...thanks..
i'm learning python from myself..
and learned enough to code a range of progs.
but i need some help..
as i came to search some STEALTHY apps for ANDROID platform..
CAN you build one for me..?
as i'm not good enough to do that..
:(

eh..i think you like challenges too...
;)
so, here it is-
"i want to make an app which records ALL incoming-outgoing CALLS on an ANDROID 2.3 based Mobile...which works IN BACKGROUND...
and after recording...it E-mails that recorded file to ME ;-)"

PLEASE mail me regarding this...
if u r willing to help me out..
its really urgent!!

lust4hell(at)gmail.com


thanks...!!
:)

neo said...

LoL well tried to put it in to a lanague of Challenge for me.
But I am not interested to develop a script so you can monitor your girl friends phone. :)