Javatpoint Logo
Javatpoint Logo

Volley Library Fetching JSON Data from URL

In this tutorial, we will fetch the JSON data from the URL using Volley library. Volley is an HTTP Library which provides the facilities for the network connectivity of our app.

The advantages of using the Volley library are as follows:

  • More comfortable and faster request management.
  • It provides efficient network management.

Android Volley Fetching JSON Data from URL Example

In this example, we will load the JSON data from the URL using Volley library. The JSON data contains the String "name", String "imageurl" and String "description" of tutorials. After fetching the data from the URL, they are displayed in ListView. You can refer more about JSON parsing tutorial at

Let's create a JSON data which contains the following information.

JSON data at URL (provide your URL of information) =

The JSON data looks like as:

Volley Library Fetching JSON Data from URL

Create an activity_main.xml in layout and add the following code.


Now, create a list_item.xml file in the layout directory which contains the row items for ListView. This contains one ImageView for image display and two TextView for text display.


Create a data model class with name and information String "name", String "imageurl" and String "description".

Create a custom adapter class named as and extend ArrayAdapter to handle the custom ListView. In this class we are calling an anonymous class new ImageDownloaderTask(holder.imageView).execute(imageUrl) to download images from URL.

Add the following library files in the build.gradle file.


Creating an anonymous class which extends AsyncTask<>. This class downloads (or fetch) the images from URL while executing doInbackground() method and returns the result (bitmap) to onPostExecute(). In onPostExecute() method, the bitmap are set to the ImageView.

In class, we are fetching and parsing the JSON data from the URL using Volley.

Add the Internet permission in AndroidManifest.xml



Volley Library Fetching JSON Data from URL
Next TopicAndroid Linkify

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA