5

I have looked at http://developer.android.com/resources/dashboard/platform-versions.html

enter image description here

2.1 : 27.2%
2.2 : 63.9%
2.3 : 0.8%
2.3.3 : 1.7%
3.0 : 0.2%

I am pretty sure I will use Android 2.1 as my version, covering almost 94% of current users. When I go to set up an android application in eclipse, I see this screen

new android project

The documentation says

Min SDK Version

This value specifies the minimum API Level required by your application.

What does that mean? Does that mean I can pick 2.3 for my build target, but select 7 as the min sdk version and have all devices running 2.1 supported?

Josh
  • 16,286
  • 25
  • 113
  • 158

4 Answers4

4

I found a similar post ( Android Min SDK Version vs. Target SDK Version ). Here's part of the answer:

android:minSdkVersion

An integer designating the minimum API Level required for the application to run. The Android system will prevent the user from installing the application if the system's API Level is lower than the value specified in this attribute. You should always declare this attribute.

android:targetSdkVersion

An integer designating the API Level that the application is targetting.

Community
  • 1
  • 1
pecka85
  • 752
  • 7
  • 21
3

You're correct. The application simply won't install on devices with lower API level. And won't be visible in Android Market for such devices.

Here are listed all API levels: http://developer.android.com/guide/appendix/api-levels.html

pawelzieba
  • 16,082
  • 3
  • 46
  • 72
2

It is my understanding that the "Min SDK Version" controls whether or not your users receive the "This application is not supported" message box. For example, if they were running 1.6 (API 4) and you inserted a 7 in that box.... they'll receive the message regardless of whether or not you've checked the 1.6 box.

I never quite understood why it appears that this can be arbitrarily set. I think it's set up that way to allow the developer to build against multiple targets and features without being forced to have compatibility with only one SDK version.

tamarintech
  • 1,972
  • 12
  • 17
  • I can build my app against more than one version of android? Does this mean I could use 2.1 as my build target and if I don't use any features not offered in earlier version (multitouch for instance), the app would run on an earlier version as long as the min sdk was set correctly? – Josh Apr 14 '11 at 15:47
  • I haven't tried it, but I'm under the impression that you can at least build parts of the application with different versions of the SDK. I think, for example, if you wanted to use both the legacy GL-hack-on-a-surface-thing (1.6) as well as the new GLSurface (I think this is 2.0) you could actually build against both. You would have to include a check for version and availability of features in your code and call the appropriate method. – tamarintech Apr 14 '11 at 16:01
  • Wow, the resource provided by the accepted answer is perfect! Thanks for that! – tamarintech Apr 14 '11 at 16:03
2

min-sdk=7 (Android 2.1) means your app cannot be installed in device with API level 6 (android 2.0.1) or below (1.5 or 1.6). Of course you can install your app in device with API level 7 or above ( > 2.1).

anticafe
  • 6,816
  • 9
  • 43
  • 74