JAVA Code
Here is the part of my code written by me in JAVA . As you can see, this is a class with a name JC_VerificationCandidatein which there are two members String enrollmentIDand seedIndex.
class JC_VerificationCandidate {
public JCDSM_VerificationCandidate( String enrollmentID, String seedIndex ) {
this.enrollmentID = enrollmentID;
this.seedIndex = seedIndex;
}
public String enrollmentID;
public String seedIndex;
}
Here is the main class where I have my own method and where I called this own method from.
public class DsmLibraryTest extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
JCDSM_VerificationCandidate verificationCandidate[] = {new JCDSM_VerificationCandidate( "tom", "anna" )};
dsm.JDSMVerify( 123456, "http:\\www.test_url.com", bytes, verificationCandidate );
}
public native int JDSMVerify(
int someValue1,
String someValue2,
byte[] someValue3,
JC_VerificationCandidate jVerificationCandList[] );
}
As you can see, I create an array with one object and pass it to my function.
JCDSM_VerificationCandidate verificationCandidate[] = {new JCDSM_VerificationCandidate( "tom", "anna" )};
JNI Code
How do I get two lines enrollmentID, eedIndexwhich I set out java-application and stored in jVerificationCandList?
JNIEXPORT jint JNICALL Java_com_Dsm_Test_DSM_JDSMVerify( JNIEnv* env, jobject thiz, jint jhDevice, jstring jurlID,
jbyteArray jInputInfo, jobjectArray jVerificationCandList ) {
}
source
share