I'm currently involved in development of an Android framework that would make it possible to delegate a method invocation to a server (with a JVM running), which will execute the method and return a result, so it would operate in a quite similar fashion to well-known Java RMI. Our team also have a plan to implement a dynamic code loading, so that you will be able to execute Android class's methods on the server even if it doesn't know that class implementation yet (it would download the definition of an object's class first).
Accordingly, I'm trying to figure out what would be the best way to export Android class to the server at run-time. The main problem is that Dalvik operates on *.dex
files that have different structure and are differently handled than *.class
files executed by a typical JVM.
So far, we've been thinking about specifying that dx tool should keep certain *.class
files when compiling source code. There is such an option as --keep-classes
, but it preserves classes globally, while we won't need *.class
file for every single class. Also, there is no way to manage dx tool options from the ADT Eclipse, as far as I know.
What approach would be best for us to follow in your opinion?