You must have
cls = env->FindClass("ClassifierWrapper");
Then you need to call the constructor to get a new object:
jmethodID classifierConstructor = env->GetMethodID(cls,"<init>", "()V");
if (classifierConstructor == NULL) {
return NULL;
}
jobject classifierObj = env->NewObject( cls, classifierConstructor);
You get a static method (although the method name is incorrect). But you need to get the instance method since getString () is not static.
jmethodID getStringMethod = env->GetMethodID(cls, "getString", "()Ljava/lang/String");
Now call the method:
rv = env->CallObjectMethod(classifierObj, getStringMethod, 0);
const char *strReturn = env->GetStringUTFChars(env, rv, 0);
source
share