Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Min SDK Version and Max SDK Version setting

Tags:

android

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

like image 946
tntv Avatar asked Jan 14 '14 02:01

tntv


People also ask

What minimum SDK should I use Android?

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.

How do I choose Android SDK 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.

What is the difference between target version and minimum version?

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.


2 Answers

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.

like image 147
A--C Avatar answered Sep 27 '22 19:09

A--C


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.

like image 44
ianhanniballake Avatar answered Sep 27 '22 18:09

ianhanniballake