java Programming Glossary: jnienv
How to return an array from JNI to Java? http://stackoverflow.com/questions/1610045/how-to-return-an-array-from-jni-to-java JNIEXPORT jintArray JNICALL Java_ArrayTest_initIntArray JNIEnv env jclass cls int size jintArray result result env NewIntArray..
Pinning a Java application to the Windows 7 taskbar http://stackoverflow.com/questions/1834599/pinning-a-java-application-to-the-windows-7-taskbar setAppUserModelID JNIEnv env LPCWSTR id L com.stackoverflow.homework.MyApplication HRESULT..
Best way to throw exceptions in JNI code? http://stackoverflow.com/questions/230689/best-way-to-throw-exceptions-in-jni-code to throw. Here are some examples jint throwNoClassDefError JNIEnv env char message jclass exClass char className java lang NoClassDefFoundError.. ThrowNew env exClass message jint throwNoSuchMethodError JNIEnv env char className char methodName char signature jclass exClass.. free msgBuf return retCode jint throwNoSuchFieldError JNIEnv env char message jclass exClass char className java lang NoSuchFieldError..
How to pass C structs back and forth to Java code in JNI? http://stackoverflow.com/questions/3923299/how-to-pass-c-structs-back-and-forth-to-java-code-in-jni JNICALL Java_com_myorg_MyJavaClass_createNewMyStruct JNIEnv env jobject this return createNewMyStruct JNIEXPORT void JNICALL.. void JNICALL Java_com_myorg_MyJavaClass_processData JNIEnv env jobject this jintArray data jint numObjects jobject arguments..
How to compile dynamic library for a JNI application on linux? http://stackoverflow.com/questions/3950635/how-to-compile-dynamic-library-for-a-jni-application-on-linux Signature V JNIEXPORT void JNICALL Java_Hello_sayHello JNIEnv jobject #ifdef __cplusplus #endif #endif Then I created Hello.cpp.. namespace std JNIEXPORT void JNICALL Java_Hello_sayHello JNIEnv env jobject obj cout Hello World endl return And now the part.. HelloImpl.h JNIEXPORT void JNICALL Java_Hello_sayHello JNIEnv env jobject obj sayHello return Finally we can compile them..
Calling a java method from c++ in Android http://stackoverflow.com/questions/5198105/calling-a-java-method-from-c-in-android jni.h jstring Java_the_package_MainActivity_getJniString JNIEnv env jobject obj jint depth JavaVM vm JNIEnv env JavaVMInitArgs.. JNIEnv env jobject obj jint depth JavaVM vm JNIEnv env JavaVMInitArgs vm_args vm_args.version JNI_VERSION_1_2 vm_args.nOptions.. jni.h jstring Java_the_package_MainActivity_getJniString JNIEnv env jobject obj jstring jstr env NewStringUTF env This comes..
passing string array from java to C with JNI http://stackoverflow.com/questions/5972207/passing-string-array-from-java-to-c-with-jni call GetStringUTFChars on it. Like this void MyJNIFunction JNIEnv env jobject object jobjectarray stringArray int stringCount..
Why do constructors in java not have a return type? [duplicate] http://stackoverflow.com/questions/6801500/why-do-constructors-in-java-not-have-a-return-type constructor is a nonstatic void method jstring MyNewString JNIEnv env jchar chars jint len jclass stringClass jmethodID cid jcharArray..
How do I load my own Java class in C on Android? http://stackoverflow.com/questions/6838397/how-do-i-load-my-own-java-class-in-c-on-android vm AndroidGetJavaVM This returns a valid JavaVM object JNIEnv env vm AttachCurrentThread vm env 0 jclass theSubClass env FindClass..
Embed Java into a C++ application? http://stackoverflow.com/questions/7506329/embed-java-into-a-c-application is defined int main JavaVM jvm denotes a Java VM JNIEnv env pointer to native method interface JDK1_1InitArgs vm_args..
how to call java function from c++? http://stackoverflow.com/questions/819536/how-to-call-java-function-from-c by the Java program callback situation you can cache the JNIEnv pointer. As an advice be careful caching pointers to the JVM..
How to access the Java method in a C++ application http://stackoverflow.com/questions/992836/how-to-access-the-java-method-in-a-c-application #include stdio.h int main int argc char argv JavaVM vm JNIEnv env JavaVMInitArgs vm_args vm_args.version JNI_VERSION_1_2 vm_args.nOptions..
|