title: How to get particular values from JSON response by using Android code?
body: <p>I need to get Particular Object values ( A, B, C, D) and related key values <code>(@"name" )</code>.  After getting <code>(A, B, C, D )</code> object values I need to list out into list view Android. Here below I have posted my sample code and response. Please help me.</p>
  
  <pre><code>@Override
          protected Void doInBackground(Void... arg0) {
              // Creating service handler class instance
              ServiceHandler sh = new ServiceHandler();
  
              // Making a request to url and getting response
              String jsonStr = sh.makeServiceCall(url, ServiceHandler.GET);
              Log.d("Response: ", "&gt; " + jsonStr);
  
              if (jsonStr != null) {
                  try {
                      JSONObject jsonObj = new JSONObject(jsonStr);
  
                      contacts = jsonObj.getJSONArray("response");
                      Log.d("Response: ", "&gt; " + contacts);
  
                      // looping through All Contacts
                      for (int i = 0; i &lt; contacts.length(); i++) {
                          JSONObject c = contacts.getJSONObject(i);
  
                      }
                  } catch (JSONException e) {
                      e.printStackTrace();
                  }
              } else {
                  Log.e("ServiceHandler", "Couldn't get any data from the url");
              }
  
              return null;
          }
  </code></pre>
  
  <p>My JSON Response :</p>
  
  <pre><code>{"response" : [  {
  
                  "A"   :  [   {  
                           "name" : "tango" 
                             },
                         {
                          "name" : "ping"
                         }
                       ],
  
                  "B"  :  [   {  
                           "name" : "tango" 
                             },
                         {
                          "name" : "ping"
                         }
                      ]
               } ]}
  </code></pre>