Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 519
Crocodile Avatar asked Jun 17 '12 15:06

Crocodile


People also ask

What is the difference between compileSdkVersion and targetSdkVersion?

Even if the compileSdkVersion and targetSdkVersion have completely different meanings they are obviously not independent. targetSdkVersion cannot be higher than the compileSdkVersion simply because we cannot target things that we know nothing about during compilation.

What is targetSdkVersion in Android Studio?

android:targetSdkVersion — Specifies the API Level on which the application is designed to run. In some cases, this allows the application to use manifest elements or behaviors defined in the target API Level, rather than being restricted to using only those defined for the minimum API Level.

Where is project properties in Android Studio?

You can create this file manually in project root directory, near other ". properties" files.

What is minimum SDK and target SDK in Android?

The min sdk version is the earliest release of the Android SDK that your application can run on. Usually this is because of a problem with the earlier APIs, lacking functionality, or some other behavioural issue. The target sdk version is the version your application was targeted to run on.


1 Answers

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.

like image 119
Ajmal M A Avatar answered Oct 18 '22 09:10

Ajmal M A