This is the second step of becoming an Android Developer. The first one describes creating and interacting with the UI. What’s next? Lists.

Interacting with the UI. Creating lists. Creating custom views. Taking pictures. Downloading data. Storing data. Make it delightful with Material Design.

We’ve learned how to create a 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 to know how to implement it because we’ll need it eventually in our daily basis.

In Android we have two ways of implementing a list — ListView and RecyclerView. The first one is a good old UI component which is in the Android SDK since the very beginning. I used it a lot of times when an app needed some scrolling list. But then the RecyclerView was announced with the 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 — responsibilities are split so it’s a good change.

We should use the RecyclerView if we are able to, but to understand why, we’ll implement the list in both ways starting with the ListView. Thanks to that we’ll see the difference between them and we’ll have a better understanding of why the RecyclerView was created.

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

How to implement a ListView?

How to implement a RecyclerView?

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