Hello Friends, in my last post “RecyclerView Implementation With CardView Basic Example In Android” we learn multiple things like how to create RecyclerView, how to use CardView, how to create an adapter class, about modal class etc. Today in this post we work on JSON data and learn how to fetch JSON data using volleylibrary and how to display these data in RecyclerView by creating an Android App in Android Studio.

JSON:JSON stands for JavaScript Object Notation. This is a lightweight human-readable syntax for storing and exchanging data between a server and a browser. JSON is also best alternative to XML.

Components (we will use it for the appearance and functionality)

1) RecyclerView: We will use this component to display a large amount of data in a list, this is the basic and important component of this app. It provides a feature to implement the list in form of horizontal, vertical and Expandable.

2) CardView: This component helps in creating a good looking UI, we use it in this app to design RecyclerView item. With the help of this component, we can work on shadow, elevation, corner radius etc.

3) Volley: Volley is a library that makes networking for Android apps easier and most importantly, faster. It has so many features some of them are:

It helps in multiple concurrent network connections.

It has a great feature of customization.

It provides powerful Debugging and tracing tools.

It provides Auto network requests scheduling functionality.

4) Glide: Glide is a fast and efficient image loading and media management open source library for Android. There are so many features of glide like disk cache, memory cache, fetch the image, resize the image, display a remote image etc.

5) Gson: Gson is a Java-based open source library developed by Google, it is also known as Google Gson. It is used for serialization and deserialization of Java objects to JSON.

With the help of making an app, we learn how to fetch JSON data using volleylibrary and display it in RecyclerView. Before start to creating app see the demo app given below.

Demo

Create New Project

Before Implementing the following code first create a new project in Android Studio, go to File => then go to New => then select NewProject option. In Add an activity option select default activity(Blank Activity) and proceed.