Some time ago I created an experimental extension for dynamically calling Android API methods using text commands, as shown below.
The extension allows you to:
• Dynamically create widgets by the name of their classes
• Call Android API methods for Thunkable widgets and dynamically created ones
• Add widgets to Thunkable to the list for further work with them
• Create screens programmatically
• Use generic event handlers for specified event types
• Get list of methods of the specified class
• View the log of the execution of commands
• Combine commands in the script xml-format
Experimental example, extension and sample script files can be downloaded
callfromstring.zip (94.7 KB)
Documentation in Russian:
http://droidscript.ru/main/statyi/appinventor_extcallfromstring.php