How to roll your own Tcl/Tk based Android app


As of 11th of February 2014 with AndroWish's Thomas Alva Edison edition it is possible to invent your own Tcl/Tk app using AndroWish's runtime environment.

Fetch the HelloTclTk ZIP archive which contains the example source code and build files and use them as a basis for a Tcl/Tk Android app. Tools needed are Android SDK, JDK, and Apache ant. Eclipse can be used as well.

Preparation: unpack, change into the HelloTclTk folder, invoke android update project in order to recreate some property files. This need be done only once.

Generation: invoke ant debug in the HelloTclTk directory. The resulting HelloTclTk-debug.apk file is built into the bin directory.

Testing: install the apk file on your device or Android emulator using adb install -r bin/HelloTclTk-debug.apk. Ensure to prior have installed AndroWish, then start the HelloTclTk app on the device using the Android launcher.

Own experiments: your Tcl source code must be put under HelloTclTk/assets/app on the development system. The very first file which gets sourced at runtime must be named main.tcl as in the example. During app building the assets folder is packed into the app's apk file and at runtime mounted on startup of the AndroWish environment as /assets/assets, i.e. the startup script is /assets/assets/app/main.tcl. You should use [file dirname [info script]] in your main.tcl to refer to other files in the same folder.

Things to adapt for your own app: