Project SDK versions
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.
Defining project SDK versions
Section titled “Defining project SDK versions”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 }}Parameters
Section titled “Parameters”|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
Section titled “Remarks”There are four relevant SDK versions in every project: