Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6016323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:57:58+00:00 2026-05-23T02:57:58+00:00

JAVA Code Here is some part of my code that I have written in

  • 0

JAVA Code

Here is some part of my code that I have written in JAVA, As you can see this is a class called JC_VerificationCandidate that have two String members enrollmentID and 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 main class where I have native method and from where I called that native method.

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 array with one object and give it to my function.

JCDSM_VerificationCandidate verificationCandidate[] = {new JCDSM_VerificationCandidate( "tom", "anna" )};

JNI Code

How can I get that two strings enrollmentID, eedIndex that I have set from java application and which are stored in jVerificationCandList ?

JNIEXPORT jint JNICALL Java_com_Dsm_Test_DSM_JDSMVerify( JNIEnv* env, jobject thiz, jint jhDevice, jstring jurlID,
                                                         jbyteArray jInputInfo, jobjectArray jVerificationCandList ) {


}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:57:58+00:00Added an answer on May 23, 2026 at 2:57 am

    The following code should allow you to access the field enrollmentID. Use the JNI String functions to read/manipulate them.

    // Load the class
    jclass jclass_JCV = env->FindClass(env, "my.package.JC_VerificationCandidate");
    
    jfieldID fid_enrollmentID = env->GetFieldID(env, jclass_JCV, "enrollmentID" , "Ljava/lang/String;");
    
    // Access the first element in the jVerificationCandList array 
    jobject jc_v = env->GetObjectArrayElement(env, jVerificationCandList, 0);
    
    // get reference to the string 
    jstring jstr = (jstring) env->GetObjectField(env, jc_v, enrollmentID);
    
    // Convert jstring to native string
    const char *nativeString = env->GetStringUTFChars(env, jstr, 0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some Java code that uses curly braces in two ways // Curly
I have this java code: <script src=http://www.google.com/jsapi></script> <script type=text/javascript> google.load(jquery, 1.2.6); $(a#more).click(function() { $(#info_box).show(blind,
I'm looking for Java code that can be used to generate sound at runtime
I'd like to write some (java) code that takes a PDF document, and creates
When indenting java code with annotations, vim insists on indenting like this: @Test public
I have troubles using the java ServiceLoader in a NetBeans module application. Here is
I have a multithreaded Java code in which: several threads read stateful objects from
Our Java code (not the test code) reads files from the current directory, which
Given the following Java code for generating a binary file: DataOutputStream out = new
When running the following Java code, I get very accurate and consistent results in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.