Java Code
In Java code I have class called IdentificationResult which has 3 members:
enrollmentIDenrollmentSettingsidentParams.
Here is the class:
package com.vito.android.framework.service;
class IdentificationResult
{
class IdentParams {
byte[] otp;
String seedId;
}
String enrollmentID;
String enrollmentSettings;
List<IdentParams> identParams;
}
In the main class I have function IdentificationResult GetAuthenticationStatus( ), here is the main Class:
public class TokenManager
{
/* Some code goes here ... */
public IdentificationResult GetAuthenticationStatus( )
{
/* Function do some actions here ... */
return new IdentificationResult;
}
}
C++ Code
I call Java method from my C++ code in this way
void GetAuthenticationStatus( )
{
// Attach current thread.
JNIEnv *env = NULL;
m_javaVM->AttachCurrentThread( env, NULL );
if( env == NULL ) {
return -1;
}
jclass clazz = NULL;
clazz = env->GetObjectClass( m_classObject );
if( clazz == NULL ) {
return -1;
}
// Get class method.
jmethodID clazzMethod = NULL;
env->GetMethodID( clazz, "GetAuthenticationStatus", "(V;)Lcom/vito/android/framework/service/IdentificationResult;" );
if( clazzMethod == NULL ) {
return VCS_RESULT_ERROR;
}
// Call Java 'GetAuthenticationStatus' function.
jobject methodReturnObj = env->CallObjectMethod( m_classObject, clazzMethod );
// Get IdentificationResult Class from Object.
jclass identifyResultClass = env->GetObjectClass( methodReturnObj );
if( identifyResultClass == NULL )
{
return -1;
}
// Get identParams.
jfieldID fieldID = env->GetFieldID( identifyResultClass , "identParams", "***1. Question***");
if( fieldID == NULL ) {
return -1;
}
else
{
*** 2. Question ***
}
}
Questions
What I must write here to get
List<IdentParams>field ID?How I can Get or Set field value?