11

While creating an android project if i say that the Build Target of my Android porject is 2.2 (API Level is picked as 8) and in the text box for Min SDK version. If i put some value apart from the API level (smaller or greater than 8) of the build target then what happens?

Does the build happen according to the build target specified, but the application developed is compatible with the smaller android versions (if i specify API level < 8 ). Or the application developed is only compatible for the higher android version (if i specify API level > 8 ).

Can anyone please explain?

OMG Ponies
  • 325,700
  • 82
  • 523
  • 502
Adithya
  • 2,923
  • 5
  • 33
  • 47
  • 4
    possible duplicate of [Android Min SDK Version vs. Target SDK Version](http://stackoverflow.com/questions/4568267/android-min-sdk-version-vs-target-sdk-version) – Mr_and_Mrs_D Sep 21 '13 at 20:52

4 Answers4

13

There is a similiar question already posted with an excellent answer:

Read the post by Steve H.

Android Min SDK Version vs. Target SDK Version

Community
  • 1
  • 1
Justin Shield
  • 2,390
  • 16
  • 12
  • ok..so you mean the "Build Target" in eclipse project creation is like targetSDKVersion ? If yes only then does the above mentioned link explains my answer. – Adithya Jul 06 '11 at 11:55
  • The build target in eclipse maps to the target SDK version. I.e. If you want to use features in Froyo, you need your build target to be 2.2 or higher. Eclipse will link the correct API library into your project. – Justin Shield Jul 06 '11 at 23:39
  • But in my manifest.xml file i can't see target SDK version specified ! It only has min SDK version. Does eclipse use the taret sdk version only for building the application ? or for which purpose ? – Adithya Jul 07 '11 at 02:51
  • Eclipse uses the Target SDK for linking and building the appropriate Android JAR file into the project. The min SDK inside the manifest will also affect the end result when it builds, targetSDK is not a manifest setting. – Justin Shield Jul 07 '11 at 03:13
  • so ,it sort of becomes like we are specifying android 2.2 (API level 8) in the build target but aren't using any special features introduced in API level 8 as we are also supplying min SDK version as 4 .Am i guessing right ? Because if we say min SDK version = 4, we need to develop an appln which will support an android device with (API level 4) i.e. android 1.6. Am i guessing correct ? – Adithya Jul 07 '11 at 06:49
  • This should be converted into the comment as it's just redirecting to existing SO thread! – Paresh Mayani Apr 21 '15 at 05:47
4

Say you set the manifest API level to 4, then the app will work on any api 4 device provided. BUT the project will be built to API level 8 so if you have any post-level 4 api methods in your code then the app will crash.

Kenny
  • 5,522
  • 2
  • 18
  • 29
0

You can only put min SDK version less than your target version,it tell that your application can support to that min SDK version,but you should confirm that your application should run under min SDK version supported devices since the Build target versions may use new APIs which are available for that specific version and those APIs may not available in min SDK versions

sunriser
  • 770
  • 3
  • 12
  • so ,it sort of becomes like we are having android 2.2 (API level 8) but aren't using any special features of the API available if we are supplying min SDK version as 4 .Am i guessing right ? Because if we say min SDK version = 4, we need to develop an appln which will support a phone with (API level 4) i.e. android 1.6 i.e. we won't be using any special API features provided with API level 8 (Android 2.2 )? Am i guessing correct ? – Adithya Jul 06 '11 at 12:00
0

ok.. if you have developed an application using particular sdk for instance Android 2.2 and your minSDKversion is < 8 then application is falsely declaring to android system that It can be installed in Android device having sdk version less than Android 2.2. In that case if application happens to install on Android 2.1 and if you re using API that are exculsiviely avaialbe in Android 2.2 platform and not on Android 2.1 then your application will crash on the device. if your minsdkversion > 8 then application won't get installed on the device having Android sdk 2.2 or lower version

success_anil
  • 3,659
  • 3
  • 27
  • 31