Define JNI Functions and Convert Java Parameters to C++ Parameters in VC++

Include the following definition:

 #include 

The function definition goes like:

 JNIEXPORT jboolean JNICALL MethodName(     JNIEnv *env,/*env variable: must*/     jstring functionId,/*String variable*/     jobject objectId/*Object variable*/){   const char *str = env->GetStringUTFChars(                             functionId, 0);   CString		functionIdStr(str);   env->ReleaseStringUTFChars(functionId, str);   jclass DetailClass = env->GetObjectClass(                            objectId);   /*DetailClass: The type of object passed as    input*/}
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: