The way I see it, I can have the minSdkVersion=4 and targetSdkVersion=10 but set the build target to API Level 4. What will happen? Eclipse assumes I'm developing for API Level 4 and any method, constant or whatever defined on API Levels above 4 will not be available to me. If I try to use them, the application will not compile.
When you set the build target to API level 4, Eclipse will not let you compile any methods you use higher than that, because it strictly uses API level 4. However, when you put the build target to a higher API level, in your case API level 10, your APK is available for use for phones from API level 4 to 10.
The 2nd question's answer answers your question, that is the Android build target, both minSdkVersion
and targetSdkVersion
affects the range of users that are able to use your application.
EDIT:
Since you're not going to define targetSdkVersion
and you're not using any features which is above API level 4, the targetSdkVersion
will be the same as minSdkVersion
. Whatever build target your chose will automatically be specified. It doesn't really matter which build target you pick unless it is below API level 4
From Android documentation of targetSdkVersion
:
An integer designating the API Level that the application targets. If not set, the default value equals that given to minSdkVersion.
This attribute informs the system that you have tested against the target version and the system should not enable any compatibility behaviors to maintain your app's forward-compatibility with the target version. The application is still able to run on older versions (down to minSdkVersion).