One of the difficulties of adapting the Groovy language is that, as we
said, Groovy is a highly dynamic language. One of its capabilities is
executing scripts at runtime. So what if we wanted to type a Groovy
script on the device, and execute it directly on it? Is it possible?
In fact, yes, it is possible, given that you follow this process:
You can have an application, written in Groovy or not, but in the end,
once the application is running, you have Groovy source code that you
want to execute. Then it needs to compile the classes, call dex
directly on the device, package the result into a jar file on the
local filesystem, then load it using a special classloader. So why
this is possible, the process is very complex, not straightforward,
but more importantly, it is dramatically slow.