-2

I have the following JSONObject:

{"Questions":
        "{Question5=[Answer1, Answer2, Answer3, Answer4], Question4=[Answer1, Answer2, Answer3, Answer4], Question3=[Answer1, Answer2, Answer3, Answer4], Question2=[Answer1, Answer2, Answer3, Answer4], Question1=[Answer1, Answer2, Answer3, Answer4]}"
}

I am really new at working with JSON. What I need is array of JSON objects, each key is Question5, Question4 etc. and the values to be the answers. Can you help?

dephinera
  • 3,703
  • 11
  • 41
  • 75
  • Have you looked at [Jackson](http://jackson.codehaus.org/) or [GSON](https://code.google.com/p/google-gson/)? – mkobit Sep 27 '14 at 20:09
  • Go to json.org to learn the JSON syntax. It only takes 5-10 minutes to learn. But note that if you dump Maps & Lists, or the Map/List equivalent objects used by some JSON APIs, they may not display (in `println` via `toString()`) exactly like the JSON source. – Hot Licks Sep 27 '14 at 20:19
  • But it does look suspiciously like your "Questions" string is really just a String, and not JSON. – Hot Licks Sep 27 '14 at 20:21

1 Answers1

-1

you need to parse it. i recommend GSON library to do so. but as i see your string is NOT JSON. json should be key : value and not key=value as your string

Dima
  • 8,586
  • 4
  • 28
  • 57