jni example
03 March 2014
new double object
jclass doubleClass = env->FindClass("java/lang/Double");
jmethodID doubleCreator = env->GetMethodID( doubleClass, "<init>", "(D)V" );
jdouble v = 123.123;
jobject doubleObject = env->NewObject( doubleClass, doubleCreator, v );
new spring context
jclass springAppContextClass = env->FindClass("org/springframework/context/support/FileSystemXmlApplicationContext");
jmethodID creator = env->GetMethodID( springAppContextClass, "<init>", "(Ljava/lang/String;)V" );
jstring fileName = env->NewStringUTF( "applictionContext.xml" );
springAppContext = env->NewObject( springAppContextClass, creator, fileName );
GetMethodId( jclass, methodName, (arg1Type;…)returnType
void or value type: V void, I jint, J jlong, D jdouble, Z boolean
constrator method name
<init>
blog comments powered by Disqus