What is the difference between the 'target' settings in the 'project.properties' file and the 'android:targetSdkVersion' tag in the manifest?-ThrowExceptions

Exception or error:

How do they differ? Or are they the same? As I understand both of these define what SDK version the app should be compiled against.

Please help to clarify. Thanks in advance

How to solve:

The docs say

android:targetSdkVersion: 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

If not set, the default value equals that given to minSdkVersion. Which indicates market will filter devices with lower sdk.

target=android-sdk version in project properties file indicates Eclipse will not allow use methods or classes from sdk higher than
this one.

ie. One related to the development environment and other related to android devices.

###

target in project properties is the Android version your project is compiled against.

targetSdkVersion in the manifest is the Android version your application is targeted to. For example if you set the target version to 14 and up, Android v4 will show specific ICS features such as the action bar.

http://developer.android.com/guide/topics/manifest/uses-sdk-element.html

Leave a Reply

Your email address will not be published. Required fields are marked *