Category: Blog, Android, Development

Android Developer Beginner. Step #2 – Creating Lists

Step by Step Guide for Android developer beginner Creating lists

This is the second article from our series which points out the most crucial parts in the beginning of Android development, step by step. Let’s focus on creating lists!

This is the whole list of topics that I would like to touch:

  1. Interacting with the UI
  2. Creating lists
  3. Creating custom views
  4. Taking pictures
  5. Downloading data
  6. Storing data
  7. Making it delightful with Material Design

In the previous article, we learned how to create simple UI components like TextViews or Buttons. However, to create a list, we have to do more than just find an ID of a view. It’s worth knowing how to implement it because we’ll need it on a daily basis.

ListView and RecyclerView

In Android, we have two ways of implementing a list — ListView and RecyclerView. The first one is a good old UI component, which has been included in the Android SDK since the very beginning. I used it a lot of times when an app needed a scrolling list.

The RecyclerView, however, was announced with Android Lollipop. It’s a kind of ListView2 but the name isn’t accidental. RecyclerView introduces a few more components that we should use, but it’s not a big deal – the responsibilities are split, so it’s a good change.

NEED A SUCCESSFUL TEAM?

We’re 100% office based team with 7-years’ experience
in mobile & web app development

Estimate project

Generally, it’s better to use RecyclerView when it’s possible. But to understand why it’s worth doing this, we first need to implement lists using both ways. Let’s start with ListView.

Both implementations are separated into different posts, as well as the final comparison of the two. Thanks to this, if you aren’t interested in the ListView, you can jump straight to the RecyclerView without endless scrolling. However, I encourage you to read all of three articles.


How to implement a ListView

HOW TO IMPLEMENT A LISTVIEW


How to implement a RecyclerView

How to implement a RecyclerView


What’s the difference between a ListView and a RecyclerView?

What is the difference between ListView and RecyclerView?


Wrap up

Thanks to these three articles, we’ve learned how to implement a ListView, a RecyclerView and what’s the difference between them.

Generally, the main point of this is to know why we should use the RecyclerView instead of the ListView, if we are able to do so, in our project. A lot of ListView’s disadvantages were improved or solved with answers implemented in the RecyclerView, so even if we think about the RecyclerView as too complicated, we should give it a chance. Implement it a couple of times and – believe me – it’ll turn out to be very easy. The next step will be about custom views. Stay tuned!


The post was written by Mateusz Budzar, Droids On Roids Android Developer. This and other articles of Mateusz you can find also on Medium