I need to implement some functions into an Android application using NDK and thus JNI.
Here\'s the C code, with my concerns, that I wrote:
#include &
Some problems with your code.
First, why are you creating your own Point class rather than using library-provided android.graphics.Point?
Second, the class spec for nested classes is different - it would be "com/example/ndktest/NDKTest$Point". Class nesting is different from packages.
Third, I don't think JNI lets you create instances of nonstatic nested classes. You need to pass the nesting class object' this pointer at object creation - there's no such argument.
Finally, while I've seen the guidance to use "void(V)" as a constructor method signature, but this is out of line with the rest of method signatures; normally, a method with two int parameters and void return type would be "(II)V".
As a side note, I found it much cleaner to pass primitive types and arrays of primitive typed from NDK to Java. Object creation/access is messy and hard to debug.