Android TutorialAdding a FuseView to an Android ProjectAndroid 9-Patch ImagesAndroid Accessing SQLite databases using the ContentValues classAndroid Accounts and AccountManagerAndroid ACRAAndroid ActivityAndroid Activity RecognitionAndroid adb (Android Debug Bridge)Android adb shellAndroid AdMobAndroid AIDLAndroid AlarmManagerAndroid Android-x86 in VirtualBoxAndroid Animated AlertDialog BoxAndroid AnimatorsAndroid Annotation ProcessorAndroid Architecture ComponentsAndroid AsyncTaskAndroid AudioManagerAndroid AudioTrackAndroid AuthenticatorAndroid AutoCompleteTextViewAndroid Autosizing TextViewsAndroid Barcode and QR code readingAndroid Bitmap CacheAndroid Bluetooth and Bluetooth LE APIAndroid Bluetooth Low EnergyAndroid Bottom SheetsAndroid BottomNavigationViewAndroid BroadcastReceiverAndroid Building Backwards Compatible AppsAndroid ButterKnifeAndroid ButtonAndroid Callback URLAndroid Camera 2 APIAndroid Camera and GalleryAndroid Canvas drawing using SurfaceViewAndroid Capturing ScreenshotsAndroid CardViewAndroid Check Data ConnectionAndroid Check Internet ConnectivityAndroid CleverTapAndroid ColorsAndroid ConstraintLayoutAndroid ConstraintSetAndroid ContentProviderAndroid ContextAndroid CoordinatorLayout and BehaviorsAndroid Count Down TimerAndroid Crash Reporting ToolsAndroid Create Singleton Class for Toast MessageAndroid Creating Custom ViewsAndroid Creating Overlay (always-on-top) WindowsAndroid Creating Splash screenAndroid Custom FontsAndroid Dagger 2Android Data Binding LibraryAndroid Data Encryption/DecryptionAndroid Data Synchronization with Sync AdapterAndroid Date and Time PickersAndroid DayNight Theme (AppCompat v23.2 / API 14+)Android Define step value (increment) for custom RangeSeekBarAndroid Design PatternsAndroid Device Display MetricsAndroid DialogAndroid Displaying Google AdsAndroid Doze ModeAndroid DrawablesAndroid EditTextAndroid Email ValidationAndroid EmulatorAndroid Enhancing Alert DialogsAndroid ExceptionsAndroid ExoPlayerAndroid FastjsonAndroid fastlaneAndroid FileProviderAndroid FirebaseAndroid Firebase App IndexingAndroid Firebase Cloud MessagingAndroid Firebase Crash ReportingAndroid Firebase Realtime DataBaseAndroid FloatingActionButtonAndroid Formatting phone numbers with pattern.Android Formatting StringsAndroid FragmentsAndroid FrescoAndroid game developmentAndroid Gesture Detection

Android Project SDK versions

From WikiOD

An Android application needs to run on all kinds of devices. Each device may have a different version on Android running on it.

Now, each Android version might not support all the features that your app requires, and so while building an app, you need to keep the minimum and maximum Android version in mind.

Parameters[edit | edit source]

Parameter Details
SDK Version The SDK version for each field is the Android release's SDK API level integer. For example, Froyo (Android 2.2) corresponds to API level 8. These integers are also defined in Build.VERSION_CODES.

Remarks[edit | edit source]

There are four relevant SDK versions in every project:

targetSdkVersion is the latest version of Android that you have tested against.

The framework will use targetSdkVersion to determine when to enable certain compatibility behaviors. For example, targeting API level 23 or above will opt you in to the runtime permissions model.

minSdkVersion is the minimum version of Android that your application supports. Users running any version of Android older than this version will not be able to install your application or see it in the Play Store.

maxSdkVersion is the maximum version of Android that your application supports. Users running any version of Android newer than this version will not be able to install your application or see it in the Play Store. This should generally not be used as most applications will work on newer versions of Android without any additional effort.

compileSdkVersion is the version of the Android SDK that your application will be compiled with. It should generally be the latest version of Android that has been publicly released. This defines which APIs you can access when writing your code. You cannot call methods introduced in API level 23 if your compileSdkVersion is set to 22 or lower.

Defining project SDK versions[edit | edit source]

In your build.gradle file of main module(app), define your minimum and target version number.

android {
    //the version of sdk source used to compile your project
    compileSdkVersion 23

    defaultConfig {
        //the minimum sdk version required by device to run your app
        minSdkVersion 19
        //you normally don't need to set max sdk limit so that your app can support future versions of android without updating app
        //maxSdkVersion 23
        //the latest sdk version of android on which you are targeting(building and testing) your app, it should be same as compileSdkVersion
        targetSdkVersion 23