Introduction
- JSON is faster than XML.
- JSON uses arrays.
- JSON is very easy to read and write.
- The loading and parsing time of JSON is less than XML loading and parsing time.
- The size of data in JSON data is less than XML data.
[{"id":"102","name":"amir","salary":"500000"},{"id":"103","name":"Ashwani","salary":"6000000"}]}
Step 1
Create a project like this:

Step 2
Create an XML file and write the following:
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- android:paddingBottom="@dimen/activity_vertical_margin"
- tools:context=".MainActivity"
- android:background="#f610">
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:id="@+id/textView1"
- android:textStyle="bold"
- android:textColor="#ffffff"
- android:textSize="15dp"
- />
- </RelativeLayout>

Sam HobbsPosted Nov 1, 2013, 7:24 PM
Is JSON as easy and efficient to use in all languages as it is in JavaScript?