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 &
The specification is correct, but a bit misleading in this case. GetMethodID requires a method name and a method signature. The specification says:
To obtain the method ID of a constructor, supply
as the method name and void (V) as the return type.
Note that it says return type, not signature. Although void(V) looks superficially similar to a signature, the specification is telling you that the signature must specify a void (that is, V) return type.
The correct signature for a no-argument constructor is ()V. If the constructor has arguments, they should be described between the parentheses, as other commenters have noted.