Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What build target and min SDK version should you choose?

Hey, I'm building just a basic app with text, urls, pictures, and some buttons. When you create a new project what build version do you usually choose? The highest, 2.2? And also what min SDK version do you choose? Also 2.2? or the lowest one possible?

I'm a little confused by what would be best for all customers

-Thanks!

like image 450
MJ93 Avatar asked Dec 07 '10 20:12

MJ93


People also ask

What is the minimum SDK version should I choose?

minSdkVersion is the minimum version of the Android operating system required to run your application. The Android app must have a minimum SDK version 19 or higher. If you want to support devices below API level 19, you must override minSDK version.

Which SDK version should I use in Android Studio?

Get Android Studio For the best development experience with the Android 11 SDK, use Android Studio 4.2 or higher. You can compile and test Android 11 apps using Android Studio 3.3 and higher, but some users of the Android 11 SDK may encounter Gradle sync failures and warnings about outdated dependencies.

What is target SDK version used for?

The Target Android Version (also known as targetSdkVersion ) is the API level of the Android device where the app expects to run. Android uses this setting to determine whether to enable any compatibility behaviors – this ensures that your app continues to work the way you expect.

What should be the compile SDK version?

1 Support Library, you must have a compileSdkVersion of at least 23 (those first numbers need to match!). In general, a new version of the Support Library is released alongside a new platform version, providing compatibility shims to newly added APIs as well as new features.


2 Answers

You should choose what you want to support.

If you want the latest API features, choose 2.2 (or soon 2.3). But if you want to include all possible phones, you need to go as low as 1.5 for the min target. The catch is that if they are using a 1.5 device you have avoid making API calls that only exist in a later version of Android.

like image 159
Bryan Denny Avatar answered Oct 22 '22 05:10

Bryan Denny


It just depends on what you want to do. If you want to support multiple Android versions then do what Falmarri said. Select the lowest API version you want to support for minSDK and choose the API version you are targeting for the buildTarget.

However you have to keep in mind that you might have to handle certain stuff in a different way for different API versions which might require if-else blocks checking for the API version. It is nothing hard to do nor something magic just keep it in mind and check the reference page on the classes and methods you use.

like image 22
Octavian A. Damiean Avatar answered Oct 22 '22 03:10

Octavian A. Damiean