Question

I followed a tutorial provided on stackoverflow (http://www.pclviewer.com/android/androidJNI.html) to import a device specific library to handle a scanner (Honeywell 70e Black).

the TJDexClassLoader does instantiate correctly (not nil...) but I just can't load the inner class I'm needing...

cl.loadclass(stringtoJString('com/honeywell/decodemanager/DecodeManager'))

I opened the library under eclipse, i multiple times checked the string and it's OK, but I get this exception :

java.lang.ClassNotFoundException: com/honeywell/decodemanager/DecodeManager

I already know that if it works, I'll be immediately stuck on a new problem : providing Context and Handler to the class I'll be instantiating, which signature is :

(Landroid/content/Context;Landroid/os/Handler;)V 

Thanks in advance for your help or advices ^^

Était-ce utile?

La solution

My mistake was thinking the DexClassLoader was generating the .dex file, but it was extracting it from .apk files, and .jar files don't contain it.

Once the .dex file generated and forced into the archive, everything works great!

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top