24

I have developed an Android application build using API 13 and min-sdk also API 13. I want to incorporate the swiping across the tabs, and for the purpose I am using v4 support library.

I have following questions,

  1. Which support library I should use v4 or v13?
  2. Should I change the target to API 14? More importantly how do I decide, which should be my targeted API to compile against?
Mukesh Bhojwani
  • 2,014
  • 4
  • 20
  • 35
  • possible duplicate of [Android Support Package / Compatibility Library - use v4 or v13?](http://stackoverflow.com/questions/9926403/android-support-package-compatibility-library-use-v4-or-v13) – Léo Lam Apr 30 '14 at 13:11

3 Answers3

25

For question 1: as @StinePike said, depending on what you use as minimum, you should use v4 for min-sdk = 4-12 if your min sdk is >=13 its ok to use v13.
Update As stated by Frank in the comments, with revision 26.0.0 and above the minsdk for all support libraries is API level 14. See https://developer.android.com/topic/libraries/support-library/index.html#api-versions for more details.

For question 2: the best target depends on what you plan to do, if you want to provide some features that were introduced in a higher sdk level, you have to use higher target-sdk but make sure that you check the android version to not use android apis that are introduced in a higer sdk version on a device with an older android version

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
    // safe to use api 11 / Android 3.0 stuf
} else {
    // only use api level <= 10 stuff
}

for min-sdk its the same. if you require stuff of api level >= 10 you have to use min-sdk 10

My opinion: don't use api level < 10, its not worth it... with 10 you reach 90% of the android devices
My opinion (as of April 2016): don't use api level < 16, its not worth it... with 16 you reach ~95% of the android devices

For checking the distribution of android OS version check: https://developer.android.com/about/dashboards/index.html

Dodge
  • 8,047
  • 2
  • 30
  • 45
  • If you unzip v13 I noticed v4+v13 is in the same jar. Does that mean you can use v13 from API4 and up? Or? – powder366 Sep 11 '13 at 18:00
  • 1
    v13 contains some classes, that are not available on API < 13. so if you want to target an api < 13 you have to use v4. – Dodge Sep 11 '13 at 19:36
  • Starting with Support Library version 26.0.0, the minimum supported API level has changed to Android 4.0 (API level 14) for ALL support library packages. source: https://developer.android.com/topic/libraries/support-library/index.html#api-versions – Frank Sep 29 '17 at 12:56
10

from the developer site you can find

Note: The Support Package includes more than one support library. Each one has a different minimum API level. For example, one library requires API level 4 or higher, while another requires API level 13 or higher (v13 is a superset of v4 and includes additional support classes to work with v13 APIs). The minimum version is indicated by the directory name, such as v4/ and v13/.

I think that clearly answer your question. If you want to support lower os version ( 4 or higher) and the v4 library apis fullfill your target then use it else use v13

stinepike
  • 54,068
  • 14
  • 92
  • 112
0

As android 2.3.3 - 2.3.7 is 23.6 percents in martet now, I suggest seting minSdk = 10 for these devices especially google has provided a good solution for developers to practice better by using support v4 and v7.

To your question, a detailed answer which I've posted may help.

Community
  • 1
  • 1
ruidge
  • 1,149
  • 1
  • 15
  • 14