I have a termux session up and running on my device, and I have created the setting for external apps in .termux/termux-properties (allow-external-apps = true)
This is what I have so far in my blocks, but I am getting FAIL back from ResolveActivity:
(I am trying to run a simple ls command on the "HOME" directory, in which I have created two files, one.txt and two.txt. I have checked in the /usr/bin for the ls command, and this works directly in termux)
In the java, one of the instructions is:
Third-party program must declare
com.termux.permission.RUN_COMMAND
permission and it should be granted by user.
This doesn't seem possible from within App Inventor (and there does not appear to be anywhere in termux to set the permission) ? Any suggestions or ideas ?
Thanks to all for your input, and to Sunny for compiling the aix.
Sadly, I am still getting the Error 601, no corresponding activity found (FAIL). Tested with companion and compiled version on Android 10. I tried moving things around, renaming but to no avail.
So more work to do.
I will run app/termux through logcat, and see if there is anything different in the package/class/action requirements...
Yes, Activity Starter component can't start a service because it calls startActivity()/startActivityForResult() but to start a Service you need to call startService()/startForegroundService().
Because "Android" (or Termux or AppInventor's Activity Starter, or a combination of all three) is making it so difficult (for me, at least), I decided to search out an alternative approach.
This I found in Termux, with the ability to setup an apache http server with php. With a simple php file in Termux's htdocs directory, I am able to send linux commands using shell_exec, and receive back the standard output just using the web component. This works in a similar fashion to Juan's terminal extension. Termux provides the user with a much broader range of commands and programs to use than that which is available on most devices, plus it also has r/w access to the device storage directories, sdcard and files.
I will write a more detailed guide once I have had time to flesh out my demo app.
In the meantime, if someone is able to get things working using activityStarter (and/or an extension), then I am all ears