Android JSON parsing data

Source: Internet
Author: User

A: Introduction to JSON

JSON refers to JavaScript Object notation, a lightweight text data interchange format, similar to XML, but smaller, faster, and easier to parse than XML

Two: The comparison between JSON and XML (copy online)

Advantages:

      is simpler than XML format;  
       JSON is a better format for data interchange; XML is a better format for exchanging documents;  
      JSON is easier to machine read, uses a simple client library or self support (JavaScript),  
       JSON can be supported by browser client,  
      can support a variety of common data structures, record, list, tree;  
      21 languages support parsing and generating JSON format  
cons:

There is no CDATA-like feature in XML that is not suitable for passing binary data such as sounds and pictures;
JSON does not have the ability to display, compared with XML;
JSON is not extensible, as compared to XML.

Three: JSON is used to describe data structures in two ways

1, a collection of "name/value" pairs, also known as JSON Object, separated by ":" Before the name and value

{Name:value}

For example:

{"width": "123", "Height": "456"}

2, an ordered list of values, also known as a JSON Array

For example:

{"Employee": [{"width": "123", "Height": "345"}, {"width": "234", "height": "455"}, {"width": "566", "height": "269"}]}


Android JSON parsing data

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.