On Monday, August 13, 2018 at 1:36:51 PM UTC-7, Ricardo
kozmate.net wrote:
> Hi group.
>
>
> I have been looking for a very simple, but complete, example of a
> Androwish application. A "hello world"...
As mentioned, get the .apk file from the androwish downloads page and do an install as described in say,
https://www.greenbot.com/article/2452614/how-to-sideload-an-app-onto-your-android-phone-or-tablet.html
Next, this may be an old school way, but in the wiki,
https://wiki.tcl.tk/39474
About 50 lines in you'll find this:
JM 8/9/2014, my set of rc files...
.wishrc
set env(HOME) /sdcard
cd ~
source wishrc.tcl
"copywrc.tcl", which I only use when I install a new Androwish version:
file delete /data/data/tk.tcl.wish/files/.wishrc
file copy .wishrc /data/data/tk.tcl.wish/files
"wishrc.tcl", this is used to immediately get a file browser dialog to select the script I want to run:
sdltk textinput on
set script [tk_getOpenFile]
if {$script != ""} {
source $script
console hide
} else {
puts "hello!"
}
The key item here is that you have to create a file .wishrc and copy it to the specific androwish folder. Since this folder is protected, you can't just use a standard file copy app, you actually have to do the copy from inside androwish.
When you launch androwish the first time, you get a console window. The file copywrc.tcl is what he sources to do the file copy from within androwish.
This .wishrc file will then get invoked on the next startup of androwish, and in the example, it automatically runs a standard open file dialog and then sources whatever you pick, or just outputs "hello" to the console if you don't supply a file to source.
I started with that, except I created a directory /sdcard/home to place the 3 files he mentions, and several others I wrote, instead of just leaving them in /sdcard, and changed the setup of env(HOME)to point to that directory. I created that directory using the ES File explorer app.
There are 2 ways to get these files into a /sdcard/home directory, namely using ssh (I use sshdroid) or by using an external sd card, which you load up with files on say linux or windows (with a sd card usb adapter), and then plug the sd card into the phone and use the ES file explorer app to copy your files to the /sdcard/home directory (or wherever you prefer).