Example:
C++ struct ABC { double x, double y };
Using C++ create a jni object to pass to java:
jobject createABC( JNIEnv* env, jobject obj )
{
ABC abc;
a.x = 5.2;
a.y = 2.4;
jclass cls = env->FindClass( "ABC" ); // find the java ABC class
jmethodID mid = env->GetMethodID( cls, "
jobject jabc = env->NewObject( cls, mid, (jdouble)a.x, (jdouble)a.y);
return jabc;
}
No comments:
Post a Comment