It's still mentioned on the main ASE page: http://code.google.com/p/android-scripting/
but it isn't listed as an available interpreter, and this page
http://groups.google.com/group/android-scripting/browse_thread/thread/a07a7536b2af6f76
seems to indicate that support has been removed in the current
version.
I'd really like to build stuff for android devices (even just my own)
in Tcl. I started down the native Java route, but hundreds of MB
later and a splitting headache convinced me that it wasn't a life
enhancing option. If there is work that needs to be done to make Tcl
work on ASE again, I'm happy to help.
Cyan
I am trying to port a Tcl/Tk application to Android and carried out some tests with Pat Thoyt's tclkit 8.6 for Android on the Android emulator (no Tk):
http://www.patthoyts.tk/tclkit/android-arm/.
There you will find also a working ASE:
http://www.patthoyts.tk/tclkit/android-arm/AndroidScriptingEnvironment.apk
If you install the ASE apk you have the choice to start a shell and in this shell you can start Pat Thoyt's tclkit in the emulator after having installed it with "adb install".
It was working well on the emulator. Probably it will be more complicated to get the things running on a real Android machine.
But perhaps you would be interested in Hecl (http://www.hecl.org/docs/android.html#android_quick_start) which is written in Java and has a Tcl-like syntax.
It is very easy to add new commands to Hecl writing some lines in Java code or to get access to the Java API by a Hecl "java" command.
java android.widget.button button
set myButton [button <method> <parameter>]
This makes it possible to access the Android GUI widgets, e.g. taken from Hecl's script example lightly modified:
set myButton [button -new $context -text "Ok" -layoutparams
$layoutparams]
set callback [callback -new [list [list MyButtonCallback $arg1
$arg2]]]
$myButton setonclicklistener $callback
All Hecl scripts can be packaged to a native executable .apk bundle which can be launched directly on the Android machine.
Fair enough.
There is one available here: http://ww1.pragana.net/Android/
I have been able to install it and it was pretty easy. The TCL shell
works but I wasn't able to make the Android GUI interface to work.
Perhaps someone can pick it up and make it work. The current
maintainer does not work on it anymore.
There are some instructions on how to do it on the main page:
http://ww1.pragana.net/
> I'd really like to build stuff for android devices (even just my own)
> in Tcl. I started down the native Java route, but hundreds of MB
> later and a splitting headache convinced me that it wasn't a life
> enhancing option. If there is work that needs to be done to make Tcl
> work on ASE again, I'm happy to help.
>
> Cyan
It is possible to run Tcl on Android (or any other Linux executable
compiled for the ARM processor) without the ASE scripting environment.
You just take a Terminal app like the "Android Terminal Emulator"
written by Jack Palevich:
https://github.com/downloads/jackpal/Android-Terminal-Emulator/Term.apk
"Android Terminal Emulator is a terminal emulator for communicating with
the built-in Android shell. Emulates a reasonably large subset of
Digital Equipment Corporation VT-100 terminal codes, so that programs
like "vi", "Emacs" and "NetHack" will display properly."
Because no application is allowed to start from sdcard it is necessary
to create at first a system folder into which the tclkit (see precedent
posts) has to be pushed. "Terminal Emulator" proposes /data/local/bin.
$ adb shell
# mkdir /data/local/bin
# exit
$ adb push ~/Projekte/android/tclkit-cli-8.6b1.2-android-arm
/data/local/bin/tclkit
$ adb shell
# ls -l /data/local/bin
-rw-rw-rw- root root 1581165 2011-10-08 14:05 tclkit
Because we are not root we have to manage the permissions issue.
The command "id" in the "Terminal Emulator" will give us the necessary
information: We find we are a member of group "sdcard_rw" because this
application has the rights to read and write to the sdcard.
So we change the membership in the adb shell:
# chown root.sdcard_rw tclkit
# ls -l
-rwxr-xr-x root sdcard_rw 1581165 2011-10-08 14:05 tclkit
Now the command "tclkit" will be found and executed.
A screenshot can be seen at:
http://zdia.de/images/screenshots/Android/tclkit.png
If there were a "package java" like JTcl is providing one then there
would be given easy access to Android's GUI.
>
> So if TclBlend was in the tclkit, then you could access the Andrioid's
> APIs (including the GUIs)?
As to now, I have no experiences or lucid ideas about TclBlend. The
links in http://wiki.tcl.tk/862 are no longer valid.
But if it works like the description in the wiki tells:
"TclBlend is used to either embed C version Tcl into a running Java
process, or embed a JVM into a running C version Tcl process."
then, yes, it would be the right tool: The "Terminal Emulator" way would
embed the DalvikVM into the running C Tcl.
>
> Also, for a StarPack -- would you still need the terminal emulator -- or
> could it then be launched like any other application?
>
As I know you can launch applications on the Android only by going the
Java way.
There seems to exist some hackish way to launch applications on Android
from the shell commandline (by calling "am" or "dalvikvm") but this will
serve just for development.
A normal Android package is a zipped folder like a starpack with all the
necessary subfolders for external libraries, drawing, resources, scripts
etc.
res
|-- drawable
| |-- aicon.png
| |-- buttonhecl.png
| `-- heclicon.png
|-- layout
| |-- list_item.xml
| `-- main.xml
|-- raw
| |-- lib.hcl
| `-- script.hcl
`-- values
`-- strings.xml
David Welton implemented Hecl in a tclkit way: after having been
launched by a click Hecl will look for a file "script.hcl" and execute
it just like tclkit is doing for "main.tcl". So a starpack will not be
needed on Android.
I tried to launch JTcl from the command-line by calling the dalvikvm
with JTcl's entrypoint tcl.lang.Shell (after having "dex-ed" it) but got
a path-not-found issue.
# /system/bin/dalvikvm -Xbootclasspath:/system/framework/core.jar
-classpath /data/local/bin/jtcl.jar tcl.lang.Shell
cannot read resource "/tcl/lang/library/init.tcl"
Well, we will see.
Last not least:
After having finished my feasibility study on Hecl the good message for
the Tcl community is:
Hecl is an excellent tool for writing Tcl programs on Android!