Mukesh Bhojwani
Mukesh Bhojwani

Reputation: 2024

Android support lib v4 or v13

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?

Upvotes: 24

Views: 19892

Answers (3)

Dodge
Dodge

Reputation: 8297

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

Upvotes: 25

ruidge
ruidge

Reputation: 1139

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.

Upvotes: 0

stinepike
stinepike

Reputation: 54672

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

Upvotes: 10

Related Questions