As of version 2.4, Groovy supports Android. I want to run a Groovy script embed in Java in my Android application.
This website explains that this is possible: http://melix.github.io/blog/2014/06/grooid2.html
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.
I am excited that this is indeed possible, regardless of the speed. There is an example project here: https://github.com/melix/grooidshell-example.
Unfortunately I don't really understand the process. I have the project, which is fairly small, but I am not sure where to be looking at exactly.
Can you point me in the right direction to execute Groovy scripts embed in Java on runtime for Android?