How to parse JSON in Android for Beginners

Parse JSON for Android

In this post I will show you how to Parse JSON in Android. This tutorial is for absolute beginners. Parse JSON or Parsing JSON helps us to retrieve data from Online Database to our Android app. So lets see how to Parse JSON in Android

What is JSON?

  • JSON stands for JavaScript Object Notation.
  • In JSON information is stored in an organised and easy to access manner so it  is easily readable and understandable by humans.





  • Above shown is the format of JSON.
  • All the variables are stored in key and value pair for ex, from the above data “age” is key and “27” is a value.
  • By enclosing the variable’s value in curly braces, we’re indicating that the value is an object i.e data inside {} is object.
  • In the above data [ ] indicates an array.All the objects are stored with in an array.
  • we can access JSON data using an URL.In below example I am going to use this link “”.


How this program works:


  •  Initially we call AsyncTask from with in that(asynctask) we establish a connection to communicate with the server.
  • Server will send the JSON data back to the Asynctask in mainactivity that data is stored temporarily in by creating new objects for each rating.
  • JSON  data will be received by adapter by get method in and pass this data to the listview.
  • And our final listview will be like as shown in above image’s UI layout.


parsing JSON data:


we have to add internet access permission in our manifest file.


(use this step only if you get any errors while importing http libraries )

Add below line to gradle file after default configuration.

Add below dependencies into dependencies at the end of the gradle file.

finally your gradle file should look like this.


we have to add a listview  in activity_main.xml.


we have to create a layout contains some list of items which are display in activity-main’s listview.


create a java class called reviews, declare required variables . create getters and setters for those variables as shown below.


create class and add below code into that


open and add below code.

Finally output should look like this:



Download source code below:

[ihc-hide-content ihc_mb_type=”show” ihc_mb_who=”reg” ihc_mb_template=”1″ ]Download[/ihc-hide-content]


Please enter your comment!
Please enter your name here