Reputation: 6252
How will I know if a class I use will be compatible with older versions of android. For example, I would like to use the recyclerview (https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html) and I am developing for android version 4.3. Reading the class it does not say what android version it supports. How can this be found (in general for any class)?
Upvotes: 0
Views: 515
Reputation: 4656
you are using a feature from v7 support library. v7 Support Library is designed to be used with Android 2.1 (API level 7) and higher. see this link for details on other version of the suport library. http://www.tutorialspoint.com/android/android_support_library.htm
Also see this page for more information:
https://developer.android.com/tools/support-library/index.html
Upvotes: 0
Reputation: 1
For Support Library packages from 24.2.0 and higher it is not necessarily true that v4 = API Level 4.
As stated in this section(Version Support and Package Names in link article):
Some of the Support Library packages have package names to indicate the minimum level of the API they support, using a v# notation, such as the support-v4 package. Starting with Support Library version 24.2.0 (released in August 2016), the minimum supported API level has changed to Android 2.3 (API level 9) for all support library packages. For this reason, when working with any recent release of the support library, you should not assume that the the v# package notation indicates a minimum API support level. This change in recent releases also means that library packages with the v4 and v7 are essentially equivalent in the minimum level of API they support. For example, the support-v4 and the support-v7 package both support a minimum API level of 9, for releases of the Support Library from 24.2.0 and higher.
https://developer.android.com/topic/libraries/support-library/index.html
Upvotes: 0
Reputation: 4374
In general, the version of the support library indicates the minimum API level:
As stated on the documentation
Upvotes: 4
Reputation: 20211
For the support library, the version supported is included in the package name: v7.
http://developer.android.com/tools/support-library/features.html
For classes in general, you would have to check the documentation, ie. Toolbar: Added in API level 21.
Upvotes: 2