Artifact [931a56c74b]
Not logged in

Artifact 931a56c74b0bd597816a098a6e51ff78faa71ff7:

Wiki page [HelloTclTk] by chw 2015-11-08 14:08:30.
D 2015-11-08T14:08:30.810
L HelloTclTk
P d43d4eb7799e9e6e7e02c9c6d4be84f6729b1999
U chw
W 1877
This is an experimental subproject in the source tree of [AndroWish] found in <a href="tree?ci=tip&name=hellotcltk">HelloTclTk</a>. It uses slightly modified AndroWish and SDL Java activity classes to start up an Android activity which re-uses the shared libraries from an already installed [AndroWish] apk. This keeps the apk file rather small (few hundred kBytes compared to over 20 MBytes). Another benefit is a short turnaround during development since no native code has to be built and the resulting apk has only few files packaged.

Own experiments: your Tcl source code must be put under .../assets/app. 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 absolute path name of the startup script is /assets/assets/app/main.tcl. You should use <nowiki>[file dirname [info script]]</nowiki> in your main.tcl to refer to other files in the same folder.

Things to adapt for your own app:

  *  In AndroidManifest.xml put the Java package name of your app (package attribute) and the class name of the main activity with leading dot. This is important since the package/class names form the unique identity of the app for Android's package manager.
  *  In res/values/strings.xml change the app_name string to your app's printable name.
  *  Below src put the main class of your app using src/tk/tcl/hello/HelloTclTk.java as a template. Its package and class name must correspond to AndroidManifest.xml.
  *  Put your app's icons in the folders res/drawable-* as icon.png.

Starting with the "Back to the Future" (2015-10-21) release the preferred way of building an [AndroWish] based App is using the Software Development Kit described in [AndroWish SDK].
Z 3dccd67ae14b4d02fcafb137798c958a