Here is what I want to achieve:
I am building an Android-Application which needs to be plugin-aware. What I need to do is downloading .java files from a Web-Server and then compile them at runtime within my application and then load it into the classpath. I want to use Java because of the ease of use because I can use the plugin objects just like my stock ones.
I've seen javax.tools's way of compiling but that's not available on DalvikVM. What are the best alternatives to that (that work in a similar way)?
EDIT:
I am using .bsh-script now. This works like a charm on a JVM and should work on an Android device (which I will test next):
package de.hotware.beanshell.test;
import bsh.EvalError;
import bsh.Interpreter;
public class BeanShellTest {
public static interface InterfaceTest {
public void sayHello();
}
public static void main(String[] args) {
try {
Interpreter interpreter = new Interpreter();
InterfaceTest res = (InterfaceTest) interpreter.eval("import de.hotware.beanshell.test.BeanShellTest.InterfaceTest;" +
"new InterfaceTest() {" +
"public void sayHello() { System.out.println(\"hello\");}" +
"}");
res.sayHello();
} catch(EvalError e) {
e.printStackTrace();
}
}
public void test() {
}
}