Recommended minimum SDK version for Android projects
Are you unsure of which minimum supported Android version to choose for your project? This article will guide you through the various factors that have the greatest impact on your choice of minimal SDK. By providing a comprehensive overview of these factors, you'll be able to make a more informed decision for your project.
Introduction
Choosing the right minimum SDK version is critical for achieving a balance between device coverage and development time. Google doesn't provide much guidance when it comes to setting the version, and all we get is when creating a new project. While device coverage is an important factor to consider when deciding the minimum version, there are other aspects to keep in mind as well. For instance, the lower the version of your minimum SDK, the more time you will need to spend on maintaining your codebase and ensuring that it's compatible with all the different versions of the SDK. Additionally, the minimum SDK version you choose may limit the features that can be included in your app, as the versions for earlier SDKs do not support the latest features. Ultimately, when deciding the minimum SDK version for a project, it is important to weigh all the pros and cons carefully to ensure that the right balance between device coverage and development time is achieved.
The SDK version (API level) can be directly correlated to the Android version. For the purpose of this article, these terms will be used interchangeably.
Lets take a look at individual factors that affect minimal SDK the most.
Most popular (downloaded) Play Store apps and their min. supported Android versions
When making a decision, it's helpful to look at what others are doing. Here are the 15 most downloaded apps [1] and their minimum supported Android OS versions (games excluded):
*multiple versions, older for lower Android versions
It's clear that only a few of the top downloaded apps support Android versions lower than 5 (i.e. minSdk 21).
Recommendation: follow the trend of at least Android version 5 (i.e. minSdk 21).
Jetpack Compose
From our experience, building an app without the Jetpack Compose toolkit takes twice as much effort. To accelerate development and create an intuitive UI, we recommend using Jetpack Compose, which requires an Android 5 (minSdk 21) or higher.
Recommendation: use Jetpack Compose to accelerate development and create intuitive UI ⇒ Android 5 (minSdk 21) or higher.
Last security updates per versions
If the app handles any personal information, security should be a top priority. Security updates are a major issue in the fragmented Android ecosystem. Currently, only devices running Android 10 or newer receive security updates [3]. On average, Android versions are supported for 3.3 years [4,5]. After support has ended, new security issues can be discovered, leaving devices (and, by extension, apps) vulnerable to those issues without any fixes [6].
The older a version is, the more likely it is to be exposed to security issues.
Potential security issues include [8]:
- Remote access to sensitive credentials used for remote service authentication, such as account passwords or bearer tokens
- Local access to the same credentials
- Bypassing operating system protections that reveal memory or file contents across app, user, or profile boundaries
- Remotely bypassing user interaction requirements, such as accessing functionality or data that should require user initiation or permission
Recommendation: Select the minimum SDK version corresponding to the Android version released no more than four years ago.
Permissions
Runtime permissions were introduced in Android 6 (API 23). On lower versions, all permissions were granted at installation.
On Android 11+, runtime permissions are revoked if the app is unused for a few months.
The visibility of the permissions dialog behaves differently on Android 11+ than on lower versions [9].
Permissions do not influence the selection of the minSdk, so no recommendation can be made.
Notifications
Notifications have been changed multiple times in the past, most notably on Android 7 and 8. The setup and level of control differ between Android 8 (API 26) and earlier versions [10]. If you need a minimum SDK of less than 26, you should include a few MDs in your estimate.
Recommendation: select minSdk 26 or higher if you want to avoid supporting older versions
Android version distribution
The SDK level you choose should be based on the devices your target audience is using. If your audience primarily uses newer devices, you can set the minimal SDK level higher. However, if your audience uses a mix of older and newer devices, you may need to set a lower SDK level to ensure that your app is compatible with a wider range of devices.
Distribution of our apps
All apps have over 95% coverage with Android 9+ (api 28+).
Global Android version distribution
Data from Android Studio (December 26, 2022)
The total number of Android versions across all devices includes older versions, even if they are no longer in use.
Regional Android version distribution
Data for Czech Republic from 27.12.2022 [11]
Data for Europe from 27.12.202 [12]
Conclusion
We have provided several recommendations to consider, but their weighting should vary depending on the specific app we are building. For a project with no special requirements, we recommend setting Android 8 (API 26) as the minimum version. Here are the reasons:
- Accelerated development thanks to Jetpack Compose
- A relatively recent last security patch
- No need to support older notifications
- Reasonably good global coverage (88%)
- Good coverage in the Czech Republic (94%) and Europe (92%)
- All our apps have over 95% coverage with Android 9+ (API 28+)
Sources
[1] https://www.makeuseof.com/tag/most-popular-android-apps/
[2] https://developer.android.com/jetpack/compose/why-adopt
[3] https://en.wikipedia.org/wiki/Android_version_history#Overview
[4] https://stackoverflow.com/a/64340664/12321475
[5] https://source.android.com/docs/security/bulletin
[6] https://www.howtogeek.com/711886/what-are-android-security-updates-and-why-are-they-important/
[7] https://www.tomsguide.com/us/old-phones-unsafe,news-24846.html
[8] https://source.android.com/docs/security/overview/updates-resources#severity
[9] https://developer.android.com/about/versions/11/privacy/permissions#dialog-visibility
[10] https://developer.android.com/develop/ui/views/notifications#android_80_api_level_26
[12] https://gs.statcounter.com/android-version-market-share/mobile-tablet/europe