Android can running Linux bash scripts (see the admin blog on this site for some advanced linux scripting tricks).  And it can also run python and other scripts.  In most cases, these scripts can not communicate with the upper layers of Android.  However, there is a project called SL4A (Scripting Layer For Android) that extends a number of scripting languages to allow the scripting/Linux layer to talk to the Android layers.  SL4A is basically a service that opens a socket.  The scripts issue commands through the socket to tell the SL4A layer, running under Android, to perform the operations

ZooKeeper is similar in that it can react to external events from scripts via Android Intents.  There are two helper script installed by ZooKeeper to make this easier.  For security reasons, they must be run as root, either via su or by running them from a cron script.  Use them to report information from your cron scripts, as shown in the samples


ZooToast <message> 

This script simply takes all the arguments you give it and then makes ZooKeeper display it as a Toast with long duration.


ZooNotify <message> <url> <type>

This script has 3 arguments.  The message should be quoted so that it appears as a single argument.   It will be displayed in the description part of a notification and also as a Toast.  The url is the url to open when the notification is clicked.   The last argument is optional, and if omitted, defaults to "text/plain".

Application Manager (am)

This is a google tool, so search google for the answers, but here are some examples using it (and the above two scripts use this tool as well).

View A Text File

am start -a "android.intent.action.VIEW" -d "file:///sdcard/l2.txt" -t "text/plain"

Edit A Text File

am start -a "android.intent.action.VIEW" -d "file:///sdcard/l2.txt" -t "text/plain"

Open a Web Page

am start -a "android.intent.action.VIEW" -d "" -t "text/html"

Play Audio File

am start -a "android.intent.action.VIEW" -d "file:///sdcard/RingTones/DrWho.ogg" -t "audio/*"


Follow the pattern to open other stuff.  Intents can also start applications, start services, or just information.   However, if you want to do really advanced stuff, I suggest a program called Tasker.  By combining Linux shell scripts and a few Intents to send information to Tasker, you can accomplish some really advanced tools.  And now you can combine cron scheduling into the mix as well.

That's all for now!