The ViewGroup RecyclerView holds the views that relate to your data. Because RecyclerView is a view, you may include it in your layout just like any other UI element. A view holder object defines each individual member in the list.
Horizontal RecyclerView with Examples for Android:
Include the Recycler View widget as a dependency in your project. Implementation 'com.android.support:recyclerview-v7:28.0.0' is the most recent dependency for Recycler View.
Create the layout file activity main.xml. The principal activity.
When you need to show a large number of things and the number is changing, you should utilise RecyclerView. ListView should only be used when the number of items is constant and the screen space is limited.
An adapter serves as a link between an AdapterView and the data that underpins it. The adapter is in charge of constructing a view for each item in the data collection and providing access to the data items. Adapters are a useful tool for connecting a View to a data source.