Home » Android tutorial » Populate Android ListView using Volley: AsyncTask comparison

android_populate_listview

Populate Android ListView using Volley: AsyncTask comparison

This post describes how to populate Android ListView using Volley. In more details, this tutorial describes how to use Android Volley to populate dynamically a ListView using JSON, and then compare it against AsycnTask.
To get data, the Android app will invoke a remote service to get contact information in JSON format. and we populate the items inside a ListView.This simple example is very useful to understand Volley library and how we can integrate it.
We have already covered this topic in a previous post, and this is the chance to underline the different approaches (Volley and AsyncTask).

8 comments

  1. AndroidDev says:

    If you have complicated logic in convertContact, would it be better to use async task? Since onResponse run on main thread

  2. Fred . says:

    Sounds like an Adapter. Perhaps a ArrayAdapter, or a BaseAdapter, SimpleAdapter, CursorAdapter, or something. But none of those seem to contain the method setItemList() so I don't know.

  3. survivingwithandroid says:

    Adpt is a custom adapter. This adapter extends ArrayAdapter I will add the project to github soon. Anyway:

    public class SimpleAdapter extends ArrayAdapter {

    …..

    public void setItemList(List itemList) {
    this.itemList = itemList;
    }

    ..
    }

Leave a Reply

Your email address will not be published.