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 8369179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:34:58+00:00 2026-06-09T13:34:58+00:00

for(int i=0; i<jArray.length(); i++) { HashMap<String, String> map = new HashMap<String, String>(); json_data =

  • 0
for(int i=0; i<jArray.length(); i++) {
    HashMap<String, String> map = new HashMap<String, String>();
    json_data = jArray.getJSONObject(i);

    name = json_data.getString("name");
    map.put("id",  String.valueOf(json_data.getString("news_id")));

    map.put("title",json_data.getString("news_title"));
    map.put("shortdescription",json_data.getString("news_short_description"));
    mylist.add(map);
}

This my data and i m able to Print data in Listview lv.setAd..(mylist)

But i have to collect all news_title in string array so that i can display news title under so that i can display all data in single line with morqee .

please help me how to store data in string aray . i m new in android

  • 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-06-09T13:34:59+00:00Added an answer on June 9, 2026 at 1:34 pm

    Im not really following your question. A String is an array of chars so umm? That being said, what is the issue exactly do mean you are having trouble with Json or do want to accumlate data into a single string. Not sure exactly what is the problem here. So have 2 seperate ideas based on my limited understanding.

    A) Json issue : Getting a string into Json format in Java looks like this:

    JsonObject temp = new JsonObject();
    temp.addProperty(myString);

    then when done adding to the output create your output string

    String outputString = mySon.toJson(temp);   
    

    b) If you want to know how to accumlate data into a single string this is also easy

    myString = myString + ” ” + newStringData;

    but in the json model just keep using

    temp.addProperty(myString); //for each item you want to add
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My current code is: for(int i=0;i<jArray.length();i++){ JSONObject json_data = jArray.getJSONObject(i); String b = json_data.getString(examnames);
try { JSONArray jArray = new JSONArray(result); for(int i=0;i<jArray.length();i++) { JSONObject json_data = jArray.getJSONObject(i);
for (int i = 0; i < jArray.length(); i++) { JSONObject item_data = jArray.getJSONObject(i);
I have two arrays: int[] intArray = new int[]{point1,point2,point3,point4}; String[] strArray = new String[]{worda,wordb,wordc,wordd};
int* p_bob = new int; *p_bob = 78; The above code makes sense to
If I have: int c[] = new int[10]; and int a[][] = new int[2][3];
i have an array of integer like int [] intArray; intArray = new int[3]
Simple Short Question What exactly is the difference between int[] intarray = new int[2]{1,2};
I have a little question. I want to put some strings in an String[].
I have a variable length string where each character represents a hex digit. I

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.