Image

Imagebanana wrote in Imagejava_dev

JNI

I'm writing some JNI stuff because I have to talk to a contactless smart card reader via some Windows DLLs. I was a bit apprehensive, but it turned out to be less painful than I'd thought. I read through a tutorial, tried the Hello World example, and then built my code. It's not working, but I don't think that's because of JNI problems. The JNI part wasn't too bad.

The basic idea is that you write a class where some of the methods are declared native and have no body. Then you run javah to generate some C headers for the native methods, then you implement them in C (your language may vary).

The hard part for me was remembering how to do C coding. 8~)

Update: Seems the JNI part *isn't* working. I'm trying to read values in the C code from member variables in the class instance, and they're not arriving with anything in. 8~(