Home » Java » Android – load dinamically JAR file generated on Java

Android – load dinamically JAR file generated on Java

Posted by: admin July 12, 2018 Leave a comment

Questions:

I want to load Java classes dinamically on Android application.

I have the .jar file and i can create the .dex file on that jar with command dx. Then, how can I use them to load in Android application the classes i need?
I would to use them like:

DynamicLoadedClassJar obj = new DynamicLoadedClassInJar()
...
DynamicLoadedClassInJar obj = (DynamicLoadedClassInJar) ...

All I have is .jar file and I can generate .dex file (but i don’t know how use them).
Can you give me a snippet of code for this? Thank you

Answers: