![]() Jobject CallObjectMethodV(JNIEnv*, jobject, jmethodID, va_list) Jobject CallObjectMethod(JNIEnv*, jobject, jmethodID. (There are also Nonvirtual and Static variants of these.) Jobject ToReflectedField(JNIEnv*, jclass, jfieldID, jboolean) Jobject ToReflectedMethod(JNIEnv*, jclass, jmethodID, jboolean) JfieldID FromReflectedField(JNIEnv*, jobject) JmethodID FromReflectedMethod(JNIEnv*, jobject) Field/method IDs interoperability with Java reflection. JmethodID GetStaticMethodID(JNIEnv*, jclass, const char*, const char*) JmethodID GetMethodID(JNIEnv*, jclass, const char*, const char*) JfieldID GetStaticFieldID(JNIEnv*, jclass, const char*, const char*) JfieldID GetFieldID(JNIEnv*, jclass, const char*, const char*) JobjectArray NewObjectArray(JNIEnv*, jsize, jclass, jobject) Jobject NewObjectA(JNIEnv*, jclass, jmethodID, const jvalue*) Jobject NewObjectV(JNIEnv*, jclass, jmethodID, va_list) Jobject NewObject(JNIEnv*, jclass, jmethodID. JobjectRefType GetObjectRefType(JNIEnv*, jobject) Void DeleteWeakGlobalRef(JNIEnv*, jweak) Jweak NewWeakGlobalRef(JNIEnv*, jobject) Jint ThrowNew(JNIEnv *, jclass, const char *) Jint RegisterNatives(JNIEnv*, jclass, const JNINativeMethod*, jint) When passing arguments from C/C++ to a Java method, the jvalue union is used: In particular, jintArray does not correspond to a C++ int* and must not be used as such. Note that although jint and friends just map to the corresponding C++ integral type, all the other types such as jobject and jintArray are opaque types that must be passed to JNI functions. There are also types for a few of the more important reference types: C/C++Īnd then one for each array type: Array types C/C++ The primitive types map quite simply: C/C++ The header defines C/C++ types corresponding to the major types in Java. #Android ndk getbytearrayregion example codeNow you can invoke foo() in Java/Kotlin code just like a normal method, and your C/C++ implementation will be called. # include extern "C " JNIEXPORT void JNICALL Java_com_example_app_Main_foo(JNIEnv* env, ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |