<$BlogRSDURL$>
DailyDairy
Sunday, March 06, 2005
 
My Stint with JNI
Played around with JNI from morn to eve....Here r some insiders!:
I>>
The JNI tutorial at the Java site has some misleading information...some C++ codes have been mixed with the C versions! Esp the object arrays funciton. The correct lines (which I have compiled are:)

ret= (jobjectArray)((*env)->NewObjectArray(env,5,(*env)->FindClass(env,"java/lang/String"), (*env)->NewStringUTF(env,"")));

for(p=0;p (*env)->SetObjectArrayElement(env,ret,p,(*env)->NewStringUTF(env, seq[p]));
}

2>>
Its better to use JNI as WRAPPERS around your function than create all ur functions by the name in the header. Looking at the articles on most websites will mislead u.

3>> For the start avoid use of object arrays as much as possible

Powered by Blogger