0

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 ^^

Darkendorf
  • 463
  • 11
  • 28
  • The tutorial doesn't demonstrate loading a scanner class. It demonstrates loading something else. Can you run the tutorial's code and load *that* class? If so, then find out where your code differs. If not, then debug *that* code first before you start making changes for your own project. – Rob Kennedy Oct 25 '13 at 13:29
  • i'm waiting for the licenced version, i was doing tests with the demo version and it seems to be the point here... i tried with the simplest library possible and it didn't work either. – Darkendorf Nov 07 '13 at 15:06

1 Answers1

0

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!

hichris123
  • 10,145
  • 15
  • 56
  • 70
Darkendorf
  • 463
  • 11
  • 28