Skip to content

Instantly share code, notes, and snippets.

@frankkienl
Created July 7, 2025 09:42
Show Gist options
  • Save frankkienl/7acd6c7ffee8b85f8f1a2f2eded6c1b7 to your computer and use it in GitHub Desktop.
Save frankkienl/7acd6c7ffee8b85f8f1a2f2eded6c1b7 to your computer and use it in GitHub Desktop.

Android API levels

Let's talk about:

  • The difference between minSdkVersion and targetSdkVersion
  • What minSdkVersion and targetSdkVersion should we use?

minSdkVersion and targetSdkVersion

Both are values you pick and mention in your AndroidManifest.xml.

The minSdkVersion tells what sdk the OS should at least support, for the app to be able to install. Example: If the minSdkVersion for your app is 34 (Android 14), but the OS is 23 (Android 6), the app will not be installed.

The targetSdkVersion tells what SDK you target, as in, the highest Android version you explicitly support. Older phones will be able to install an app with a higher targetSdkVersion. Example: if the targetSdkVersion for your app is 34 (Android 14), but the OS is 23 (Android 6), the app can be installed. (Assuming the minSdkVersion is 23 or lower) Newer phone will be able to install an app with a lower targetSdkVersion too. Example: if the targetSdkVersion for your app is 34 (Android 14), but the OS is 35 (Android 15), the app can be installed.

Basically: The OS will not prevent your app from being installed because of the targetSdkVersion.
It will prevent an app to be installed because of a higher minSdkVersion.

What versions should you use?

For the minSdkVersion, there's no official recommendation. (Afaik)
But there's an unofficial recommendation, which is 23 (Android 6). See: https://x.com/minSdkVersion

You can decide to use a higher minSdkVersion, if your app needs a specific feature, only available in higher SDK versions.
But this will mean some older devices will not be able to install your app (based on the OS level)

For the targetSdkVersion, there's an official recommendation;
And if you want to publish your app to the Google Play Store, it's even a requirement. The recommended targetSdkVersion is 35+ (Android 15+) for Smartphone and Tablet targets.
It's 34+ (Android 14+) for Wear OS, Android Automotive and TV targets. See: https://developer.android.com/google/play/requirements/target-sdk

Let's have a table

Phone your minSdkVersion your targetSdkVersion Will install?
23 (Android 6) 23 35 Yes
23 (Android 6) 34 35 No
34 (Android 14) 23 35 Yes
34 (Android 14) 34 35 Yes
35 (Android 15) 23 35 Yes
35 (Android 15) 34 35 Yes
35 (Android 15) 23 34 Yes

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment