Show REST service images next to text in Android ListView

advertisements

I would like to display images from a Java REST service along side a name on an android ListView.

Assuming we have a list of Student Names and their passports in png formats on a REST server, I'll like to create a list on an Android app shows the passport of each student beside their names.

I'm able to display their names but I don't know how to go about returning their passports alongside their name on the REST service as well as displaying the passport on the ListView


You should use a RecyclerView with a ViewHolder which defines the display format for each item in the list (in your case a layout with a TextView and an ImageView) and a RecyclerView.Adapter to manage the list data. You could then load the images using a library such as Glide or Picasso.

A good basic tutorial on RecyclerView can be found here https://guides.codepath.com/android/using-the-recyclerview