Home » Android » Android Support Package / Compatibility Library – use v4 or v13?

Android Support Package / Compatibility Library – use v4 or v13?

Posted by: admin April 23, 2020 Leave a comment


I’ve just read this description of the Android Support Package / Compatibility Library…


… and it’s left me a little confused! It says that the v13 library is a superset of v4 but I thought it was the other way around?

Getting practical: If I want to use the compatibility library such that my app builds and works fine for phones running Android 2.2 (API 8) through to 4.0 (API 14) and beyond, will v4 suffice for me?

How to&Answers:

To target API 8 (v2.2) you should use the v4 version.

Large sections of the v13 will work, but if you use any of the features in it that rely on the platform 13 APIs, your app will blow up on older devices.

Unless there’s a particularly compelling reason to need v13, I’d suggest going straight for v4.


The Answer is correct but is also slightly confusing!
Currently there are 3 support jars: V4, V7 and V13.
Unfortunately V7 is specifically for gridlayout only and is therefore NOT a superset.

We are interested in only one jar from the support library [unless we also want gridlayout (I don’t know what it is!)]. Therefore we are looking at our android:minSdkVersion=”8″ and checking it against the jars. So we want V4.

V13 is only a superset in the sense that it duplicates the V4 methods, NOT the code. I.e. the use of V13 would be incorrect in this example.


I don’t think we should use superset(or subset) to describe these three libraries(v4, v7, v13) though the simplest meaning seems backward-compatible version 4, 7 and 13.

Google added Fragment in v4 first,then update it when every new version was published.That means unless your app only support the newest version (which strongly not recommended), we need support-v4 almost anytime.Suppose your minsdk is 14 which has fragment already, but ’embedded fragment’ only support after 17,so we still need v4 and use v4 fragment in that situation.

This year(2013) google published v7,and added appcompat-library in it.That means besides third support Actionbar(ActionbarSherlock) before 11, offical support maybe a better One?? Then I believe we’ll have every actionbar feature update when every new version publish in future in v7.

We still need minsdk=XX (between 7 and 10) today(Nov.24,2013).We should add support-v4 for fragment and support-v7 for actionBar both for best practice.


I checked the source code of v13, it adds only 4 more classes.

  • FragmentCompat
  • FragmentPagerAdapter
  • FragmentStatePagerAdapter
  • FragmentTabHost

FragmentCompat adds 2 static util methods which are included in v4 Fragment already.

FragmentPagerAdapter, FragmentStatePagerAdapter and FragmentTabHost, all these 3 classes have corresponding same name classes in v4, and have the same behavior.

The extra APIs provided in v13 are not necessary.

So by adding v4, you can support more platforms than v13, with same behavior with v13, so why not just use v4?

So I could not see any neccessarity for v13.
Am I right?


v13 just have functions about Fragment.
mostly if your minVersion is above 13 and not used functions like : FragmentPagerAdapter,FragmentStatePagerAdapter,FragmentTabHost,and nested fragments;
you do not need support v13.

so “v4 is a subset of v13” is incorrect!


A little late but please have a good look at the picture below.
In the JAR file android-support-v13.jar, there are 3 packages:

  • annotation
  • v4
  • v13

Meaning we just need to add this one jar, and we would have support for both v4 and v13. Since v7 is NOT in the compilation, we would need to add that JAR on our own.

enter image description here