Tcl and android

I just open this page to say that we can now run tcl on android. :)

Have a look at: http://code.google.com/p/android-scripting


CliC 2011-01-12 Apparently not anymore; see Android - An Open Handset Alliance Project and http://code.google.com/p/android-scripting/issues/detail?id=424 . :(


nscerqueira I post in the google groups the nonexistence of tcl support and then I got the following information:

"You may find all files in my web server at http://pragana.net/Android

If you want the sources (in C, with a build script), taken straight from Tcl 8.5.9 distribution (8.6.x is yet unstable), please go to the homepage http://pragana.net .

Please, add it as needed to be installed from code.google.com, because I don't intend to distribute it."

Please lets start using it and improve the use of tcl in android. Only with this effort tcl could be compared to python, lua and other scripting languages.


Googie 2011-09-01 I rooted (jail-break) my android, so I was able to re-mount my /system partition with rw permissions. Then I downloaded tclkit for android from [L1 ] (thank you Pat for providing it!). Then I put this tclkit into /system/bin and renamed to tclsh and gave +x permission. All this done with root permissions and ConnectBot android application (terminal emulator). Now I can run tclsh and write some Tcl there, also run some scripts!

Pros:

  • Tcl on android! Yeyy!!!
  • Tcl 8.6 (beta)

Cons:

  • No GUI support yet
  • No other native libraries available yet, one must relay on pure-tcl only
  • Root requirement
  • Complicated installation

I imagine that installation can be done simple for end-user using CWM package (see [L2 ] for details).

I wonder how complicated would be to implement some bindings to standard android GUI toolkit in C/C++ and compile it with android-ndk. This would give us complete package to write Tcl applications for android. The only requirement would be to install it with CWM (which many android users use anyway, but still it's a hackers way :( ).

Any thoughts?

RLH It would be awesome to use Tcl on Android.


Roy Keene KitCreator supports building Tclkits for Android/ARM (nightly builds [L3 ])


PZ Take a look at Android X server [L4 ]


Lectus: Any plans on porting Tk to Android?


beware: http://durganadar.blogspot.co.uk/2011/06/tcl-and-android.html is working for me. I've only just started playing though.


vkvalli - 2013-07-18 17:38:10

Tcl with latest SL4A

ASE is now called as SL4A. The links and the apk provided are old. They do not have latest api. For example, cameraCapturePicture or smsMessagesCount etc.

When these functions are invoked, I get "unknown rpc error". I found a way to run tcl with latest api.

Some Background intro. Scripting Layer takes some api and makes them available as json-rpc server. That is rpc server accessible through json format. It is provided as apk file and implemented in java.

The scripting language providers need to give two things. One a ported version for arm architecture. Another a module (json-rpc client) to talk to rpc server. With new api versions, the .apk file keeps updated to reflect new api. So even with a older language port, one can access the recent api version.

This is what I did. I ran a apk provided in this page through links and through it installed the zip files. Basically zip file has the cross-compiled version of Tcl. It installs tcl in some /data dir. This is good enough to run older api (2010).

For newer api, get recent version of plain SL4A apk from google. and install it. Unfortunately, It does not allow to run tcl interpreter. But still we can manage. Run it in private server mode. Through preferences set server port to 3000 (example, anything > 1000 will do).

Run the older apk that can recognise tcl. Run the tcl interpreter in it. Now we will make tcl to talk to new SL4A than its native one.

In tcl shell

   set env(AP_PORT) 3000

Then do the usual things like

   set android [android new]

Now you can invoke newer api through "$android xxx" calls. Basically it connects to a default port where its native ASE/SL4A runs. We change it to point to newer SL4A port.

Two versions of SL4A would be running . One older ASE and the other newer SL4A. Take care in navigating between apps. You should not close the app when you switch apps.

Strictly speaking we need not run the older ASE. If we can take care of invoking tclsh with right environmental parameters etc, we don't need older ASE. Since I am new to android, I just found it simple to invoke tcl in ASE and I took that approach.


Termux includes Tcl and Tk on Android 7+. It also has other goodies such as man and vim.

https://termux.com/

chw 2024-03-08

On termux it's possible to run a vanillatclsh made with LUCK. If the termux add-on termux-x11 is installed, too, even Tk of vanillawish is working including things like Canvas3d. Of course, it also has standard Tcl and Tk as installable packages, too. Nevertheless, given that there are rather cheap set-top boxen based on recent Android versions available for about 50 bucks, this might be the cheapest alternative to a Chromebook, should one have the desire to run both AndroWish and normal Tcl/Tk stuff in parallel with decent performance.