Native Methods
Implementing Native Methods
Declare native methods using jni::native_methods<> template and jni::native_method() function.
This creates constexpr array of JNINativeMethod entries at compile time.
For an instance method, the first parameter must be ref<object<"com/scapix/example1/Class1">> (or compatible).
For a static method, the first parameter must be ref<class_> (or compatible).
If all parameters are JNI types, JNI signature can be deduced.
If you omit ref<class_> first parameter for a static method or use any C++ type parameters, you must specify JNI signature.
Additionally, you can specify C++ signature to select overload.
Register native methods in JNI_OnLoad():