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?

1

4 Answers 4

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

6
  • 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 6, 2011 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. Jul 6, 2011 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 7, 2011 at 2: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. Jul 7, 2011 at 3: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 7, 2011 at 6:49
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.

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

1
  • 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 6, 2011 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

1
  • 1
    ok..so you mean the "Build Target" in eclipse project creation is like targetSDKVersion ?
    – Adithya
    Jul 6, 2011 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.