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

  • Home
  • SEARCH
  • 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 4598906
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:27:56+00:00 2026-05-21T23:27:56+00:00

I have a string array like {myname,yourname,hisname} and I am trying to send this

  • 0

I have a string array like {"myname","yourname","hisname"} and I am trying to send this array to C with using JNI. I could not find any clear solution for this. I have tried to take this string as a chararray but no success.

Is there a way to do this?

  • 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-21T23:27:57+00:00Added an answer on May 21, 2026 at 11:27 pm

    You can write a simple function that takes a jobjectArray object, cast each one to jstring and then call GetStringUTFChars on it.

    Like this:

    void MyJNIFunction(JNIEnv *env, jobject object, jobjectArray stringArray) {
    
        int stringCount = env->GetArrayLength(stringArray);
    
        for (int i=0; i<stringCount; i++) {
            jstring string = (jstring) (env->GetObjectArrayElement(stringArray, i));
            const char *rawString = env->GetStringUTFChars(string, 0);
            // Don't forget to call `ReleaseStringUTFChars` when you're done.
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have an array like this: string [] Filelist = ... I
I have a string array like this. string[] queries with data more than one
I have a multi-dim string array something like this:- string[,] names = new string[2,
I have a JSON string array of objects like this. [{id:4,rank:adm,title:title 1}, {id:2,rank:mod,title:title 2},
serial.write() method in pyserial seems to only send string data. I have arrays like
Consider a string array shaped like this: string[] someName = new string[] { First,
I'm trying to create an associative array like this: $key = '0' $arr =
How to find whether a string array contains some part of string? I have
I have an array like this (below is the var_dump) array 0 => object(stdClass)[11]
I have an array like this $data = array( 163, 630, 43, 924, 4,

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.