Version 49 of AndroWish Feature Requests

Updated 2014-03-13 18:18:43 by GCS

Features to be added to AndroWish

MG would love to see support for the vfs package, a requirement for loading starkits.

chw the vfs package is now included starting with the "James Joyce" edition (2014-01-13).

MG Brilliant, thanks for the quick response.

MG Follow-up: I installed the newer version of AndroWish in the emulator, did a

package require starkit

which worked (1.3.3). I then tried to source my starkit, but that failed with the error

can't find package vfs::mkcl
  while executing
"package require vfs::mkcl"
  (procedure "::vfs::mk4::Mount" line 4)
  invoked from within
"::vfs::mk4::Mount /storage/sdcard/Download/starkit.kit /storage/sdcard/Download/starkit.kit -readonly"
  ("eval" body line 1)
  invoke from within
"eval [list ::vfs::${driver}::Mount $self $self} $args"

chw so there's something missing in the CVS version of vfs. Can you please point me to where I can fetch a complete vfs source archive including the required stuff for starkits? There must also be some C code which needs to be adapted for Android which I didn't find on the web, either.

MG It looks like it tries to load vfs::mkcl as a fallback when the Mk4tcl package isn't available. I can't actually find any info about vfs::mkcl, but it seems Mk4tcl can be obtained from [L1 ]

chw 2014-01-18: hopefully fixed with the "Amphetamine" edition which includes the read-only tclkit vqtcl module.

MG 99%! It errors out when trying to cd to a directory in a starkit (complains it's not a directory, while under other OSes you can CD into the file structure of a starkit without a problem). Curiously, though, it has created images with image create photo -file ... which are located inside the starkit. Anyway, I removed the cd and it loaded the starkit, which seems to be running perfectly. Thank you :)

chw 2014-01-21: when I try this on /storage/sdcard0/clock.kit

package require vfs::mkcl
vfs::mkcl::Mount /storage/sdcard0/clock.kit /mystarkit

it is possible to cd into the mounted startkit on /mystarkit, to glob, and to open files.


ramsan I would like to see a short tutorial in how to compile a simple tcl package that contains c/c++ code

chw unfortunately unsupported as a standalone piece since everything is built as a whole and finally packaged into an APK. So your best option is to fetch the complete source, add your tcl package containing native code to the .../jni subdirectory of the source tree, pick one of the Android.mk makefiles from the many ported extensions, adapt it to your package, add an appropriate pkgIndex.tcl to the .../assets subdirectory, and build the beast using Android NDK/SDK and "ant". A short recipe is in Tcl/Tk on android poll.

ramsan But then ... I cannot offer the package to other users. In my specific case, I have RamDebugger running ok on Androwish. But some parts of this program are made in c++ to instrument and colorize files faster. How can I create the dynamic library for this code in order for RamDebugger to run properly?

chw 2014-01-21: glimpsed over RamDebugger-source8.1.zip and saw many DLLs and shared libraries but no source code. As stated above, you should fetch the AndroWish sources, put your sources of those DLLs/shared libraries below the .../jni subdirectory and create appropriate Android.mk makefiles. Finally, you might want to call your application "RamDebugger": you have to subclass from tk.tcl.wish.AndroWish (an empty class body should do) in order to give the application another package/class name. That java stuff is below the .../src subdirectory. Adapt the AndroidManifest.xml to that package/class name and change the resources in .../res (strings, icons) to your needs. That should give you your RamDebugger APK at the end.

ramsan 2014-01-22: You are describing how to create an application only for myself. But this is not the objective. The objective is to create a package, an editor and debugger, that can be used by any user of androwish. (NOTE: the source code is at: scripts/RamDebuggerInstrumenter.cc). You can access the fossil source code at: [L2 ]

chw 2014-01-23: then package RamDebugger into a starkit. I'm afraid, however, that for the shared libraries you have to carry out the above mentioned steps (get AndroWish sources, Android NDK, put C/C++ sources below .../jni, create Android.mk, use ndk-build to generate shared libraries). Another point to watch out for is that AndroWish builds for ARM and x86 processors, i.e. there are two versions of each shared library which you have to put into the starkit. And the package specific Tcl load command must use $tcl_platform(machine) to find out which library to load (I've never tested loading native code from a starkit, BTW).


PO would like to have an Android theme and the possibility to simulate right clicks (if possible).


jima 2014-01-14

As asked for in the Tcler's Chat:

Do you know if/how a script can be started with AndroWish instead of starting it with an interactive console and a tk default window?

This question has also arised in comp.lang.tcl:

https://groups.google.com/forum/#!topic/comp.lang.tcl/m9A6bWKPi_8

chw that is were the "borg" command comes into play as mentioned in AndroWish:

   borg shortcut add <name-of-shortcut> <file-to-be-sourced> <png-icon-as-base64-string>

The last parameter can be left out in which case Aladdin's magic device is shown. However, YMMV depending on Android version. On my 4.x devices it worked but the opposite (borg shortcut delete) did not. The <file-to-be-sourced> must be given as an absolute path and it must be readable by the user id under which the AndroWish package has been registered by the Android installer.


ed.s - 2014-02-12 02:24:31

1.BTL/RBC, please! I would love even a partial implementation - specifically, graph, if this is easier than a full implementation.

2.I am assuming things like complex/fourier can be simply included, as they are completely self contained and require no hardware access, is this right? Still, is there a place one can place such common tools? On Linux it would be /usr/share/tcl or something similar, could we have a /storage/sdcard0/AndroWish take up the same role? This would also be a good place to contain .androwishrc, to be executed at startup, if present (default font sizes, etc.). User scripts would also be placed there, and I would also write a little script that looks through this space, finds all file.tcl (and the matching file.png, if available) and create buttons associated with launching each of these (Borg shortcut ...).


Superlinux - 2014-02-26 06:08:47 There should be a way to check whether AndroWish is installed after I made my HelloTclTk package. If it's not installed, I should be able to grab it from Google Play store. Whenever chw wants, I can let him upload AndroWish releases on my Google Developer Console account by sending me the signed released package.

In HelloTclTk.java file, the following override of OnCreate(Bundle savedInstanceState) method can be added as a checkpoint. this is not Tcl. this is purely in Java.

    PackageManager pm = getPackageManager();
    List<ResolveInfo> activityList = pm.queryIntentActivities(shareIntent, 0);
    boolean AndroWish_is_installed=false;
    for (final ResolveInfo app : activityList) {
        if ((app.activityInfo.name).contains("wish")) {
           AndroWish_is_installed=true;
           break;
        }
    }
    if (!AndroWish_is_installed){
        /*don't forget to define in strings.xml the value "@string/You_Must_Install_AndroWish" ,
          just to display the same meaning in as many languages as possible.
         */
        Toast.makeText(TableOfContents.this,R.string.You_Must_Install_AndroWish, Toast.LENGTH_LONG).show();
        //Let's assume that the Androwish package name is the following string
        String package_name="tk.tcl.wish";
        //This will open the Play Store app to the following link
        Uri marketuriString = Uri.parse("market://details?id=" + package_name);
        // "market://details?id=tk.tcl.wish"
        Intent intent = new Intent(Intent.ACTION_VIEW, marketuriString);
        startActivity(intent);
    }

chw 2014-02-27: good idea. The library stuff (also in Java) which is inherited by the HelloTclTk class has a static initializer which already might have detected the absence of vital native shared libraries (since it was not able to load them). Therefore code to deal with prompting the user for AndroWish installation belongs in that library, not in the APP template. But implementing that stuff is low priority on my list, since there are more problematic open ends left.

chw 2014-03-03: this is partly solved in the Pioneer 10 edition.


bmidy - 2014-02-26 08:45:09

Hi, very nice work!!

I d like to get Tix support and also BLT like another one asked.

Thanks

chw 2014-02-26: I can see benefits of having BLT for data visualization but what gives Tix when there are ttk, treeview, tktable, tklib etc. all available and ready to use?

bmidy - 2014-02-27: Hi, I d like to get Tix as I used it a lots in many of my projects, I d like to port to android.


pbb - 2014-02-27 11:01:12

I would like to have gnocl (Tcl/GTK+ bindings) package included in AndroWish. Mainly for its text widget, which can do BIDI type rendering for Sanskrit script using the Devanagari font.

chw 2014-02-27: postponed until a stable GTK port is available for Android. Better give me a pointer to a fribidi or ICU/ubidi patch for the Tk text widget.


bmidy - 2014-02-27 14:17:29

Hi, I also wanted to use your great Androwish to open serial port using a OTG USB adapter with an USB-serial adapter. so the serial port is available as /dev/ttyUSB0 but I could not use the "fconfigure -mode" command. Is there a reason ? a workaround to open serial port.

Thanks

chw 2014-02-27: probably a permission issue. Android APPs normally aren't allowed to open character devices. Since about Android 4.0 there's support for USB device access from Java code, see the pointer to the usb-serial github project above. The downside is that the entire device driver seems to require to be written in Java. Adding the usb-serial is on my wish list, but has very low priority.


bmidy - 2014-02-27 15:52:36

Also another thing that would be interesting: As I m using a SG Note 3 I get a 1920x1080 resolution which is good but all looks like very small. So it will be nice if it would be possible to have the possibility to zoom/pinch on the screen, but without additional code, I mean if it could be built-in in the "Tk/X" implementation. I do not know If my explanation is good enough, I hope.

chw 2014-03-03: in the Pioneer 10 edition fonts are now chosen based on pixel density. It should be readable on full HD displays now.


bmidy - 2014-02-27 17:10:50

Also another things that would be usefull: Associate .tcl file with the AndroWish app, so that the Androwish start and load the .tcl file. So it would be very easy to test our scripts.

chw 2014-03-02: already implemented by android.intent.action.VIEW for file URLs with any pattern and by android.intent.action.SEND for MIME type application/x-tcl. YMMV depending on Android's launcher and/or file manager.


Superlinux - 2014-03-02 09:10:20

Hi. How can I force the virtual keyboard to be only numeric, or to make the keyboard help me in typing Internet addresses ..etc?

chw 2014-03-02: This is not supported by the underlying libSDL 2.0.1 infrastructure. What about asking for this feature on http://www.libsdl.org ? Update: seems to be controllable by a simple integer mask, will try to add this in the "sdltk textinput" command.

chw 2014-03-03: in the Pioneer 10 edition that mask is added to the "sdltk textinput" command. However, the standard event bindings don't use this feature.


Superlinux - 2014-03-04 10:53:22

Well A reminder here to everyone, if you updated to AndroWish runtime "Pioneer 10 edition, 2014-03-03", then remember to update the java library of file name "tcltkapplib.jar" that comes in the HelloTclTk skeleton project. Just re-Download the HelloTclTk skeleton project from here . Unpack the HelloTclTk.zip. From the unpacking locate and copy and replace "tcltkapplib.jar" to your own project library folder named "libs".


Superlinux - 2014-03-05 14:23:45

Regarding the keyboard input type, how about making a quick command like this:

array set entry_vs_input_type { entry1_window_path entry1_input_type entry2_window_path entry2_input_type entry3_window_path entry3_input_type ... ... }
sdltk entry_input_types $entry_vs_input_type

And this command is used at the bottom of the script after the last defined entry. And has automatic bind <Focus> for all entries in the array.


eds - 2014-03-07 00:30:23

A very simple request: could we have another env variable under AndroWish that would tell unambiguosly that we are under Android?

On my desktop: set env(MACHTYPE) yields: i686-suse-linux

Under AndroWish it is not defined. It would be very handy to test for something like this, to make AndroWish-specific changes.

chw 2014-03-07: MACHTYPE is bash specific. Run tclsh from tcsh and you get i686. Newer AndroWishes support this construct

  set android 0
  catch {set android [sdltk android]}

to safely find out if you're running on Android.


eds - 2014-03-07 00:43:13

A very useful feature:

chw 2014-03-03: in the Pioneer 10 edition fonts are now chosen based on pixel density.

BUT: it seems to override not just the defaults, but also the explicitly controlled font sizes, which messes up a picture, made with labels of a very particular size, as these labels now grow and start overlapping and make a mess of things. Pre-Edison editions worked just fine on an unedited script from Linux.

If I edit the script to scale back from 10 to 6 point font, the labels on the picture are back to normal, but if I run the same script under Linux or windows, they are way too small. Sounds like I need a system-dependent switch, or a "Auto-scale fonts" should be a selectable option under AndroWish.

chw 2014-03-07: positive font sizes are now scaled to real world points (as on UN*X/Windows/MacOSX). Negative font sizes are pixel based. If you want to control your layout on pixel basis, use negative numbers. See the Tk documentation of the font command, and play with tk scaling (which I've never tested with AndroWish).


GCS 2014-03-13

It would be nice to have events associated with the Menu and Back buttons, and the Volume Up/Down keys. Apologies if they are already there and I missed them.

PS I am really curious about the development of AndroWish--is it just a hobby, or part of your work? Do you have specific project(s) in mind? ...? Anyhow, I am very very happy you are doing it.