Hi i am having a simple type of json response ,I have worked on JSON with keys but in this response i only have the values,Please see the response as below
json
{
status: "success",
country: [
{
1: "Afghanistan"
},
{
2: "Albania"
},
{
3: "Algeria"
},
{
4: "American Samoa"
},
{
5: "Andorra"
},
{
6: "Angola"
},
{
7: "Anguilla"
},
{
8: "Antarctica"
},
{
9: "Antigua and Barbuda"
},
{
10: "Argentina"
},
{.....
.
.
.
.
.so on..
So i want to parse this JSON and want to put both the values in an ArrayList of Hashmap,I have worked as below,But find no path to proceed,Hope some buddy will help me.
code
jsonObj = new JSONObject(jsonStr);
if (jsonObj.has("country")) {
CountryArray = jsonObj.getJSONArray("country");
if (CountryArray != null && CountryArray.length() != 0) {
// looping through All Contacts
System.out
.println("::::::::::::::::my talent size:::::::::::"
+ CountryArray.length());