Using Interfaces in JNI
Posted
by lhw
on Stack Overflow
See other posts from Stack Overflow
or by lhw
Published on 2010-03-18T12:02:51Z
Indexed on
2010/03/18
12:21 UTC
Read the original article
Hit count: 314
I am trying to use (*env)->RegisterNatives
to add methods to a defined class which I then add to a callback list.
The callback sender of course expects my class to implement a certain interface which I do not. And is failing on execution.
If I add the keyword "implements Listener" to my class in Java the javac expects to have the methods definition in Java or with native keyword which I try to avoid here, as I'd like to register the methods within the JNI_OnLoad and execute one of them afterwards.
The question now is: Can I implement the interface in JNI or avoid the error message in Java?
© Stack Overflow or respective owner