On May 26, 4:00 pm, sherry <syang...@gmail.com> wrote: > I'm trying to dynamically load a jar file, then load the classes > inside the jar. The code is simple but I keep getting ClassNotFind > exception. The class is in the jar. How can I figure out what is > wrong?
Two thoughts come to mind: (1) The Dalvik VM uses its own DEX format, not Java .class files. If you have a Jar full of classfiles, it's not going to work. The VM expects to find a single "classes.dex" in a jar file. (2) For loading classes from DEX files outside your app's APK you probably want to use DexClassLoader (introduced in 1.5). URLClassLoader is not really useful for loading classes. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---