/ Published in: C++
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
NIEXPORT jobject JNICALL Java_be_arrowup_argenta_CardReader_readCardMaestroNative(JNIEnv *env, jobject obj) { jclass cls = NULL; jobject jData = jniCreateObject (env, "Data", cls); if (jCardData == NULL || cls == NULL) { return NULL; } size_t byteArrayLength = 10; //set the iso2 byte data jbyteArray jByteArray = env->NewByteArray(byteArrayLength); env->SetByteArrayRegion(isoByteArray, 0, byteArrayLength, (jbyte*)nativeByteArray); jfieldID byteArrayId = env->GetFieldID(cls, "bArrayName", "[B"); env->SetObjectField(Data, byteArrayId, jByteArray); }