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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:59:38+00:00 2026-05-23T15:59:38+00:00

Json Problem : I have this formatted JSON { Table1:[ { TableName:LoadDistributor, Description:Distributor ,

  • 0

Json Problem :

I have this formatted JSON

 {
 "Table1":[
  {
     "TableName":"LoadDistributor",
     "Description":"Distributor ",
     "MandatoryFlag":"1",
     "Status":"",
     "Priority":"0"
  },
  {
     "TableName":"LoadPrice",
     "Description":"Price ",
     "MandatoryFlag":"1",
     "Status":"",
     "Priority":"0"
  },
  {
     "TableName":"LoadProduct",
     "Description":"Product ",
     "MandatoryFlag":"1",
     "Status":"",
     "Priority":"0"
  },
  {
     "TableName":"RD.AlternativeProductDetail",
     "Description":"AltProdutDetail",
     "MandatoryFlag":"0",
     "Status":"",
     "Priority":"0"
  },
  {
     "TableName":"XA.vwTown",
     "Description":"Town ",
     "MandatoryFlag":"1",
     "Status":"",
     "Priority":"0"
  }

]
}

Android Json Processing method is:

   public String[] getStringArrayResponseJson(SoapPrimitive node, ArrayList<String> strings) {
    try{

        String result = node.toString();
        JSONObject json = new JSONObject(result);

        // Parsing
        JSONArray nameArray = json.names();
        JSONArray valArray = json.toJSONArray(nameArray);
        Log.i("@@@" , "===="+  valArray.length());
        for (int i = 0; i < valArray.length(); i++) {
            strings.add(valArray.getString(i));
        }

        json.put("sample key", "sample value");
        Log.i("REST", "<jsonobject>\n" + json.toString()
                + "\n</jsonobject>");
    }catch (JSONException e) {
    e.printStackTrace();
}

My requirement is I want to get the TableName into string[] or list… How we can do this?

Please help me what is the error in my json processing method:?

  • 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-23T15:59:39+00:00Added an answer on May 23, 2026 at 3:59 pm

    Example code, not sure that its going to work.
    I create an ArrayList for the strings just for the sake of it.

    ArrayList<String> list = new ArrayList<String>();
    JSONArray array = jsonobject.getJSONArray("Table1");        
    int max = array.length();
     for (int i = 0; i < max; i++) {
       JSONObject tmp = array.getJSONObject(i);
       list.add(tmp.getString("TableName"));
     }
    

    Might be a quicker way but just for an example.

    You could read more http://www.androidcompetencycenter.com/2009/10/json-parsing-in-android/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this very basic problem, >>> from django.core import serializers >>> serializers.serialize(json, {'a':1})
I got a small problem . I have this date format from .net json
I want to display place details from this json: I have problem with parse
I have really big problem with calling JSON with jQueryUI autocomplete. I have this
I have a problem using JSON and arrays. Here is my code: while($row =
I have a problem accessing JSON data. I'm new to JSON and jquery so
I have this problem where I do an .each() on this group of selects,
I have this form: http://jsfiddle.net/michelejs/Pt6LQ/ The problem is that I am not be able
I have this example where I am trying to access json value, but it
i have this json in my request $.get(/shop_possystems/index.php?route=module/cart/ajax_get_individual_prices&current_id= + current_id + &standard_id= + standard

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.