<uses-sdk>

syntax:
<uses-sdk android:minSdkVersion="integer" 
          android:targetSdkVersion="integer"
          android:maxSdkVersion="integer" />
contained in:
<manifest>
description:
Lets you express an application's compatibility with one or more versions of the Android platform, by means of an API Level integer. The API Level expressed by an application will be compared to the API Level of a given Android system, which may vary among different Android devices.

Despite its name, this element is used to specify the API Level, not the version number of the SDK (software development kit) or Android platform. The API Level is always a single integer. You cannot derive the API Level from its associated Android version number (for example, it is not the same as the major version or the sum of the major and minor versions).

For more information, read about Android API Levels and Versioning Your Applications.

여러분으로 하여금 API 레벨 숫자에 의해 하나 이상의 버전의 플랫폼과 애플리케이션의 호환성을 표현하게 한다. 애플리케이션에 의해서 표현되는 API 레벨은 주어진 안드로이드 시스템의 API 레벨과 비교될 것이며, 다른 안드로이드 디바이스들간에 다를 수 있다.

이 애트리뷰트의 이름에도 불구하고 이 애트리뷰트는 SDK 버전 숫자가 아니라 API 레벨을 지정하기 위해서 사용된다. API 레벨은 항상 정수integer이다; SDK 버전은 (1.5와 같이) 메이저 부분과 마이너 부분으로 나뉠 수도 있다. 여러분은 SDK 버전 숫자로부터 API 레벨을 얻을 수 없다(예를 들어 API 레벨은 메이저 버전 또는 메이저 버전과 마이너 버전의 합과 같지 않다).

attributes:
android:minSdkVersion
An integer designating the minimum API Level required for the application to run. The Android system will prevent the user from installing the application if the system's API Level is lower than the value specified in this attribute. You should always declare this attribute.

Caution: If you do not declare this attribute, the system assumes a default value of "1", which indicates that your application is compatible with all versions of Android. If your application is not compatible with all versions (for instance, it uses APIs introduced in API Level 3) and you have not declared the proper android:minSdkVersion, then when installed on a system with an API Level less than 3, the application will crash during runtime when attempting to access the unavailable APIs. For this reason, be certain to declare the appropriate API Level in the minSdkVersion attribute.

애플리케이션이 실행되기 위해 요구되는 안드로이드 API의 최소 레벨을 지정하는 정수integer. 안드로이드 시스템은 시스템의 API 레벨이 이 애트리뷰트에 지정된 값보다 더 낮다면, 사용자로 하여금 애플리케이션을 설치하는 것을 막을 것이다. 여러분은 항상 이 애트리뷰트를 선언해야 한다.

Caution: 여러분이 이 애트리뷰트를 선언하지 않으면 값이 “1”이 가정되며 이는 여러분의 애플리케이션이 모든 버전의 안드로이드와 호환된다는 것을 의미한다. 여러분의 애플리케이션이 모든 버전과 호환되지 않는다면 (예를 들어 그 애플리케이션이 안드로이드 API 레벨 3에서 도입된 API들을 사용한다면) 그리고 여러분이 적절한 minSdkVersion을 선언하지 않았다면, 그것이 더 낮은 API 레벨을 가진 시스템 상에서 설치될 때 실행되는 동안 망가질 것이다. 이러한 이유로 minSdkVersion 애트리뷰트에 적절한 API 레벨을 선언하는 것을 확인하라.

android:targetSdkVersion
An integer designating the API Level that the application is targetting.

With this attribute set, the application says that it is able to run on older versions (down to minSdkVersion), but was explicitly tested to work with the version specified here. Specifying this target version allows the platform to disable compatibility settings that are not required for the target version (which may otherwise be turned on in order to maintain forward-compatibility) or enable newer features that are not available to older applications. This does not mean that you can program different features for different versions of the platformit simply informs the platform that you have tested against the target version and the platform should not perform any extra work to maintain forward-compatibility with the target version.

Introduced in: API Level 4

애플리케이션이 타겟으로 하고 있는 API 레벨을 지정하는 정수integer.

이 애트리뷰트가 설정되면, 애플리케이션은 더 낮은 버전(minSdkVersion까지) 상에서 실행될 수 있지만, 여기서 명시된 버전에서 명시적으로 테스트되엇음을 의미한다. 이 타겟 버전을 지정하는 것은 플랫폼으로 하여금 타겟 버전을 위해서 필요하지 않은 (포워드-호환성을 유지하기 위해 켜질 수 있는) 호환성 설정을 비활성화 하도록 허용하고 또는 더 오래된 애플리케이션에 이용가능하지 않은 더 새로운 기능을 활성화 하도록 허용한다. 이것은 여러분이 다른 버전의 플랫폼에 대한 다른 기능을 프로그램할 수 있다는 것을 의미하지 않는다 - 이것은 단지 플랫폼에게 여러분이 타겟 버전에 대해서 테스트하였고 플랫폼은 타겟 버전과 포워드-호환성을 유지하기 위해 추가적인 작업을 수행해서는 안된다는 것을 알려야 한다.

Introduced in: API Level 4

android:maxSdkVersion
An integer designating the maximum API Level on which the application is designed to run.

In Android 1.5, 1.6, 2.0, and 2.0.1, the system checks the value of this attribute when installing an application and when revalidating the application after a system update. In either case, if the application's android:maxSdkVersion attribute is lower than the API Level used by the system itself, then the system will not allow the application to be installed. In the case of revalidation after system update, this effectively removes your application from the device.

To illustrate how this attribute can affect your application after system updates, consider the following example:

An application declaring android:maxSdkVersion="5" in its manifest is published on Android Market. A user whose device is running Android 1.6 (API Level 4) downloads and installs the app. After a few weeks, the user receives an over-the-air system update to Android 2.0 (API Level 5). After the update is installed, the system checks the application's android:maxSdkVersion and successfully revalidates it. The application functions as normal. However, some time later, the device receives another system update, this time to Android 2.0.1 (API Level 6). After the update, the system can no longer revalidate the application because the system's own API Level (6) is now higher than the maximum supported by the application (5). The system prevents the application from being visible to the user, in effect removing it from the device.

Warning: Declaring this attribute is not recommended. First, there is no need to set the attribute as means of blocking deployment of your application onto new versions of the Android platform as they are released. By design, new versions of the platform are fully backward-compatible. Your application should work properly on new versions, provided it uses only standard APIs and follows development best practices. Second, note that in some cases, declaring the attribute can result in your application being removed from users' devices after a system update to a higher API Level. Most devices on which your appplication is likely to be installed will receive periodic system updates over the air, so you should consider their effect on your application before setting this attribute.

Introduced in: API Level 4

Future versions of Android (beyond Android 2.0.1) will no longer check or enforce the android:maxSdkVersion attribute during installation or revalidation. Android Market will continue to use the attribute as a filter, however, when presenting users with applications available for download.
애플리케이션이 실행되도록 설계된 최대 API 레벨을 지정하는 정수integer.

안드로이드 1.5, 1.6, 2.0, 그리고 2.0.1에서, 시스템은 애플리케이션을 설치할 때, 그리고 시스템을 업데이트한 후 애플리케이션을 재검증할 때 이 애트리뷰트의 값을 검사한다. 두 가지 경우에서, 만약 애플리케이션의 android: maxSdkVersion 애트리뷰트가 시스템 자신에 의해 사용된 API 레벨보다 낮다면, 시스템은 애플리케이션이 설치되는 것을 허용하지 않을 것이다. 시스템을 업데이트한 후 재검증하는 경우에, 이것은 효과적으로 디바이스에서 여러분의 애플리케이션들을 제거한다.

시스템 업데이트 이후 여러분의 애플리케이션에 이 애트리뷰트가 어떻게 영향을 미칠 수 있는가를 분명히 하기 위해, 다음과 같은 예제를 고려하라.

매니페스트에 android:maxSdkVersion=”5”라고 선언하고 있는 하나의 애플리케이션이 안드로이드 마켓에 배포되었다. 안드로이드 1.6(API 레벨 4)이 실행되는 디바이스의 사용자가 그 애플리케이션을 다운로드하고 설치한다. 몇 주 후, 사용자는 안드로이드 2.0(API 레벨 5)으로 OTA(over-the-air) 시스템 업데이트를 수신한다. 그 업데이트가 설치된 후, 시스템은 애플리케이션의 android:maxSdkVersion을 검사하고, 그것을 성공적으로 재검증한다. 애플리케이션은 제 기능을 한다. 하지만, 얼마 후 디바이스는 다른 시스템 업데이트를 수신한다. 이번에는 안드로이드 2.0.1(API 레벨 6)이다. 업데이트 후, 시스템은 애플리케이션을 다시 유효화할 수 없다. 왜냐하면 시스템 자신의 API 레벨(6)이 애플리케이션에 의해 지원되는 최대치(5)보다 이제 더 크기 때문이다. 시스템은 디바이스에서 그것을 효과적으로 제거함으로써, 사용자에게 애플리케이션이 보여지는 것을 차단한다.

Warning: 이 애트리뷰트를 선언하는 것은 권장되지 않는다. 첫째로, 애플리케이션이 릴리즈되었기 때문에 신규 버전의 안드로이드 플랫폼에 여러분의 애플리케이션의 배치를 차단하기 위한 수단으로써 이 애트리뷰트를 지정하는 것은 의미가 없다. 계획적으로, 신규 플랫폼 버전은 완전하게 이전 버전과 호환된다. 여러분의 애플리케이션이 오직 표준 API들만을 사용하고 개발 모범 사례를 따른다면, 그것은 신규 버전에서 제대로 작동해야 한다. 둘째로, 몇 가지 경우에, 이 애트리뷰트를 선언하는 것은 더 높은 API 레벨로 시스템이 업데이트된 이후, 사용자의 디바이스에서 여러분의 애플리케이션이 제거되는 결과를 초래할 수 있다. 여러분의 애플리케이션이 설치될 가능성이 있는 대부분의 디바이스는 OTA(over the air)로 주기적인 시스템 업데이트를 수신할 것이다. 그러므로 이 애트리뷰트를 셋팅하기 전에 여러분의 애플리케이션에 대한 그것의 영향을 고려해야 한다.

도입 : API 레벨 4

(안드로이드 2.0.1 을 넘어선) 미래의 안드로이드 버전은 설치 또는 개검증하는 동안 android:maxSdkVersion 애트리뷰트를 더아상 검사하거나 또는 강제하지 않을 것이다. 하지만, 안드로이드 마켓은 사용자에게 다운로드 가능한 애플리케이션을 보여줄 때, 하나의 필터로써 이 애트리뷰트를 계속 사용할 것이다.
introduced in:
API Level 1
↑ Go to top