Android Programming The Big Nerd Ranch Guide, 3rd Edition

(Brent) #1

Parsing JSON text


487

Parsing JSON text


The JSON response displayed in your browser and Logcat window is hard to read. If you pretty print
(format with white space) the response, it looks something like Figure 25.11.


Figure 25.11  JSON hierarchy


A JSON object is a set of name-value pairs enclosed between curly braces, { }. A JSON array is a
comma-separated list of JSON objects enclosed in square brackets, [ ]. You can have objects nested
within each other, resulting in a hierarchy.


http://www.ebook3000.com

Free download pdf