Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between v4 and v13 suport library in Android

Hello I was checking support library page on android doc where I found v13 library also. I use v4 in my projects.

I understood that v4 is required If I set the minSDKVersion between 4-12 and If I set it to >=13 then I should use v13 support library.

Question

What is the use of support library v13 if we have already native Fragment classes if I set minSDKVersion to 13 because native Fragment is already from API 11 http://developer.android.com/reference/android/app/Fragment.html.

and Why they divided it into v4 and v13 if we have all features of v13 in v4 ?

like image 256
N Sharma Avatar asked Nov 30 '14 13:11

N Sharma


People also ask

What is v4 and v7 in Android?

The name of these packages ends with the minimum version of Android API supported by the libraries. For example, package name support-v4 and the support-v7 indicate that the minimum supported Android API version is 4 and 7 respectively.

Should I use legacy Android support libraries?

We recommend using the AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX as well. So all Android apps should now aim to use AndroidX, instead of the old support library.

What are the Android support libraries for?

Support Libraries provide classes and methods that closely resemble APIs in the Android Framework. Upon discovering this, you may wonder if you should use the framework version of the API or the support library equivalent.

What is the difference between AndroidX and Android support?

AndroidX is a major improvement to the original Android Support Library, which is no longer maintained. androidx packages fully replace the Support Library by providing feature parity and new libraries.


1 Answers

What is use of support library v13 if we have already native Fragment classes

You may not want to use the native Fragment classes. For example, nested fragments was only added to the native Fragment classes in API Level 17 -- if you wanted nested fragments on older devices, you have to use the backport.

Why they divided it into v4 and v13 if we have all features of v13 in v4 ?

Not every class in support-v13 works back to API Level 4. Notably, support-v13 has implementations of FragmentPagerAdapter and FragmentStatePagerAdapter that work with native fragments. support-v13 is a superset, not identical to, support-v4.

like image 171
CommonsWare Avatar answered Oct 03 '22 02:10

CommonsWare