JSON

JSON stands for JavaScript Object Notation. While originally designed for use in JavaScript, as a data-interchange format, it is language-independent. Additionally, for a variety of reasons, one being that it is relatively easy to implement, many web services offer it as an alternative to other formats that are based on XML for data transmission. It is also more lightweight, more compact, and easier for machines to parse than XML.

Android is bundled with a JSON parser within the org.json package.

We won't get too far into the exact syntax of JSON data, but here is a prototypical JSON object representation.

{"result":{"aname":"value", "anumber":1234, "aboolean":false}}

As you can see in the JSON representation, the entire representation ...

Get Pro Android Media: Developing Graphics, Music, Video, and Rich Media Apps for Smartphones and Tablets now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.