I have an app which I want to install on ICS only . So i have set the min and max sdk versions as below.
<uses-sdk android:minSdkVersion="14" android:maxSdkVersion="15" />
Ideally this should work. But some how it is able to install on Jellybean version also. ICS(API 14-15) JellBean (API 16-18)
What am I Missing here? Please help
Override the minimum value of SDK version. 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.
Click Tools > SDK Manager. In the SDK Platforms tab, select Android 11. In the SDK Tools tab, select Android SDK Build-Tools 30 (or higher). Click OK to begin install.
Minimum Android Version – Specifies the oldest Android version that you want your app to support. This API level is used at run time by Android. Target Android Version – Specifies the version of Android that your app is intended to run on. This API level is used at run time by Android.
According to the documentation:
Future versions of Android (beyond Android 2.0.1) will no longer check or enforce the maxSdkVersion attribute during installation or re-validation. Google Play will continue to use the attribute as a filter, however, when presenting users with applications available for download.
The behaviour seen is expected. However, if you publish to Google Play, the application will be filtered.
Unless you have some feature that absolutely requires only older APIs (airplane mode comes to mind), then such a limitation does not serve much purpose.
If you're concerned about non Google Play sources or users sideloading the app, you can always do a runtime check for the Android version and either restrict features or close the app.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLYBEAN){
//do something about the Android version being too new
}
Keep in mind that if you want your app to reach the largest userbase, you will have to address the issues caused by the new Android versions at some point.
Per the maxSdkVersion documentation:
Future versions of Android (beyond Android 2.0.1) will no longer check or enforce the maxSdkVersion attribute during installation or re-validation. Google Play will continue to use the attribute as a filter, however, when presenting users with applications available for download.
Filtering will still work from Google Play, but you can sideload the app onto any device with a higher SDK version than the minimum.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With