2

I know that in Java is possible to compile a Java class at runtime on the fly (in memory) from a String representation. Afterwards, such class can be instantiated in the application. For example, some libraries providing support for this are BeanShell and commons-jci.

Is it possible to do the same in an Android application ?

Sergio
  • 8,532
  • 11
  • 52
  • 94
  • Yes, it is possible, however the tools to do so are not present on an Android device (Android does not actually use Java at runtime, only dalvik code derived therefrom), so a java-to-davlik-bytecode toolchain capable of running on the device would have to be found/created/adapted and packaged in your application. Most practical needs would have more direct possible solutions such as providing dalvik bytecode instead - unless your goal is to run user-entered java code. – Chris Stratton Sep 23 '13 at 17:08

0 Answers0