This is an experimental subproject in the source tree of AndroWish found in HelloTclTk. 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 [file dirname [info script]] 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.
Although this approach is able to spare megabytes of dependencies to be installed, it does not work on Android releases 6.0 and newer. Thus, don't use it anymore.