Android Development

Introduction to JSON

JSON stands for JavaScript Object Notation. It is a format for data exchange and storage. When compared to XML, it is very simple and easy to parse information interchange format. JSON is extensively used for data exchange between the device and server in android applications. 

JSON uses two types of brackets that are as follows: 

  • [] – To declare the elements of Array in JSON, they’re written in square brackets. 
  • {} – To create JSON objects, the elements are written in curly brackets. 

JSON has the following types of structures that are: 

1. JSON Objects 

The elements inside the curly brackets are known as Objects. 

2. JSON Array 

A list of values, known as Arrays. 

3. JSON Key-Value 

This data is stored as a pair of keys and values 

JSON Example: 

{ “staff”: [ 

{ “name”: “John Doe”, “city”: “Houston”}, 

{ “name”: “Max Warden”, “city”: “California”}, 

]} 

 
Async Task (Prev Lesson)
(Next Lesson) Web Service
Back to Android Development

No Comments

Give a comment