My task is to dynamically instantiate classes in my android app from a jar file that has been written/compiled by someone else. I used this example: Is it possible to dynamically load a library at runtime from an Android application? to get started, it works great with APK files but I'm unable to use DexClassLoader to load classes from JAR files. I think its because my JAR file doesn't have classes.dex.
I'm trying to use "dx --dex --keep-classes --output=newjar.jar my.jar" on a simple hello world java class, but the generated JAR only contains my .class files and doesn't have classes.dex
Question 1: Is it possible to use android dx tool to generate classes.dex for non-android java files?
Question 2: What are the minimum requirements for dx tool to generate classes.dex?