androidandroid-studioandroid-recyclerviewgradle-dependencies

Using RecyclerView on Newer Android Devices


Is it important to add dependencies for RecyclerView if my app is only going to run on Android Lollipop and newer versions?

A lot of tutorials keep adding these dependencies but I am not sure if they do it to support very old devices.

Thanks.


Solution

  • Short Answer

    There is no need to include additional dependencies for RecyclerView.

    Extended Answer

    Since your app is going to run on Android Lollipop (API Level 21) and newer versions, it is not necessary to add specific dependencies for RecyclerView. RecyclerView is part of the Android Support Library, which was included to provide backward compatibility for older versions.

    Since API level 21, RecyclerView was included in the Android framework, so you can use it without adding any dependencies in your gradle file, now are in the AndroidX libraries, so now the RecyclerView class is available in androidx.recyclerview.widget, which is part of the AndroidX libraries.