After having a short look at Google I found this link that describes the difference between a JSON object and a JSON array, yet from a syntax point of view.
When would one be used over the other in a programming scenario?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
When you are working with JSON data in Android, you would use
JSONArrayto parse JSON which starts with the array brackets. Arrays in JSON are used to organize a collection of related items (Which could be JSON objects).For example:
[{"name":"item 1"},{"name": "item2"} ]On the other hand, you would use
JSONObjectwhen dealing with JSON that begins with curly braces. A JSON object is typically used to contain key/value pairs related to one item.For example:
{"name": "item1", "description": "a JSON object"}Of course, JSON arrays and objects may be nested inside one another. One common example of this is an API that returns a JSON object containing some metadata alongside an array of the items matching your query: