0

I have a JSONObject like this

{
"status": "fails",
"validation": {
"a": [
  "fd",
  "message 1"
],
"aa": [
  "2",
  "Message 2"
],
"aaa": [
  "2",
  "Message 3"
],
"afda": [
  "2",
  "Message 4"
],
"ada": [
  "2",
  "Message 2"
],
"aca": [
  "2",
  "Message 5"
]
},
"debug": "",
"data": null
}  

Because the JSONObject in my project is dynamic.
So, is it possible to get all values in this JSONObject regardless the keys?

For example: My desire result is an array of string: ["message 1","message 2","message 3","message 4","message 5"]

Ngo Van
  • 857
  • 1
  • 21
  • 37
  • 2
    This will be of help. http://stackoverflow.com/questions/13573913/android-jsonobject-how-can-i-loop-through-a-flat-json-object-to-get-each-key-a Cheers! – JayR May 30 '14 at 03:41
  • Try Gson for json parsing ,this is easy and fast than json parser. – Rohit Goswami May 30 '14 at 04:05

1 Answers1

0

Try this Example it is use full

android_json_parser

And This

android-json-parsing-tutorial

NagarjunaReddy
  • 8,621
  • 10
  • 63
  • 98