Versioning is a critical component of your application upgrade/maintenance strategy.
버전을 부여하는 것은 여러분의 애플리케이션을 업그레이드/유지보수하기 위한 전략의 중요한 요소이다.
The Android system itself does not ever check the application version information for an application, such as to enforce restrictions on upgrades, compatibility, and so on. Instead, only users or applications themselves are responsible for enforcing any version restrictions for applications themselves.
안드로이드 시스템은 업그레이드, 호환성 등에 대한 제약을 강제하기enforce 위해 애플리케이션에 대한 애플리케이션 버전 정보를 확인하지는 않는다. 대신에 사용자나 애플리케이션 스스로가 애플리케이션에 대한 임의의 버전 제약을 강제하는 것에 대해 책임이 있다.
The Android system does check any system version compatibility expressed
by an application in its manifest, in the minSdkVersion attribute. This
allows an application to specify the minimum system API with which is compatible.
For more information see Specifying Minimum System API Version.
안드로이드 시스템은 애플리케이션의 매니페스트의 minSdkVersion 애트리뷰트에 나타나는 시스템 버전 호환성을 체크한다. 이것은 애플리케이션으로 하여금 호환가능한 최소한의 시스템 API를 지정하는 것을 허용한다. 더 많은 정보는 16장. 애플리케이션 버전 부여하기의 최소 시스템 API 버전 지정하기를 보라.
To define the version information for your application, you set attributes in the application's manifest file. Two attributes are available, and you should always define values for both of them:
애플리케이션 버전 정보를 정의하기 위해서, 여러분은 애플리케이션의 매니페스트 파일의 애트리뷰트를 설정한다. 두 개의 애트리뷰트가 사용 가능하며, 여러분은 두 개의 애트리뷰트 값 모두를 정의해야만 한다.
android:versionCode An integer value that represents
the version of the application code, relative to other versions.
The value is an integer so that other applications can programatically evaluate it, for example to check an upgrade or downgrade relationship. You can set the value to any integer you want, however you should make sure that each successive release of your application uses a greater value. The system does not enforce this behavior, but increasing the value with successive releases is normative.
Typically, you would release the first version of your application with
versionCode set to 1, then monotonically increase the value with each release,
regardless whether the release constitutes a major or minor release. This means
that the android:versionCode value does not necessarily have a
strong resemblence to the application release version that is visible to the
user (see android:versionName, below). Applications and publishing
services should not display this version value to users.
android:versionName A string value that represents the
release version of the application code, as it should be shown to users.
The value is a string so that you can describe the application version as a <major>.<minor>.<point> string, or as any other type of absolute or relative version identifier.
As with android:versionCode, the system does not use this value
for any internal purpose, other than to enable applications to display it to
users. Publishing services may also extract the android:versionName
value for display to users.
이 값은 예를 들어 업그레이드나 다운그레이드 관계를 확인하기 위해서 다른 애플리케이션이 프로그램적으로 그것을 평가할 수 있는 정수integer 값이다. 여러분이 원하는 임의의 정수integer로 그 값을 설정할 수 있다. 하지만 여러분은 애플리케이션 각각의 다음 릴리즈가 더 큰 값을 사용하도록 보장해야 한다. 시스템이 이것을 강제하는 것은 아니지만, 다음 릴리즈 값을 증가시키는 것이 표준이다.
일반적으로, 여러분은 첫 번째 애플리케이션 버전에 versionCode 1을 설정해서 릴리즈한다. 그런 다음에는 그 릴리즈가 메이저 또는 마이너 릴리즈든 상관없이 단순하게 각각의 릴리즈 값을 증가시킨다. 이것은 android:versionCode 값이 사용자에게 보여지는 애플리케이션 릴리즈 버전을 꼭 닮지 않아도 되는 것을 의미한다(아래의 android:versionName를 보라). 애플리케이션과 배포 서비스는 사용자에게 버전 값을 보여주지 않는다.
이 값은 여러분이 애플리케이션 버전을 설명할 수 있도록 하는 하나의 문자열이다. 그것은 <major>.<minor>.<point> 문자열로써 표현되거나, 또는 절대적 또는 상대적인 어떤 다른 버전 식별자 타입으로 표현된다.
Android:versionCode와는 다르게, 시스템은 이 값을 어떤 내부 목적으로도 사용하지 않는다. 그 보다는 애플리케이션은 이 값을 사용자에게 보여주기 위해 사용한다. 배포 서비스는 또한 사용자에게 보여주기 위해, android:versionName 값을 추출해 낼 수도 있다.
You define both of these version attributes in the
<manifest> element of the manifest file.
여러분은 매니페스트 파일의 <manifest> 엘리먼트에 있는 이러한 버전 애트리뷰트들 모두를 정의한다.
Here's an example manifest that shows the android:versionCode
and android:versionName attributes in the
<manifest> element.
여기에 <manifest> 엘리먼트에 있는 android:versionCode와 android: versionName 애트리뷰트들을 보여주는 예제 매니페스트가 있다.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.package.name"
android:versionCode="2"
android:versionName="1.1">
<application android:icon="@drawable/icon" android:label="@string/app_name">
...
</application>
</manifest>
In this example, note that android:versionCode value indicates
that the current .apk contains the second release of the application code, which
corresponds to a minor follow-on release, as shown by the
android:codeName string.
이 예제에서, android:versionCode 값은 현재의 .apk가 애플리케이션 코드의 두 번째 릴리즈를 포함하지만, android:codeName 문자열에 의해 보여지는 것처럼 마이너한 후속의 릴리즈에 해당한다는 것에 유의하라.
The Android framework provides an API to let applications query the system
for version information about your application. To obtain version information,
applications use the
getPackageInfo(java.lang.String, int)
method of PackageManager.
안드로이드 프레임워크는 애플리케이션으로 하여금 여러분의 애플리케이션에 관한 버전 정보를 시스템에 재질의requery하는 API를 제공한다. 버전 정보를 얻기 위해, 애플리케이션은 패키지 매니저PackageManger에 있는 getPackageInfo(java.lang.String, int) 메쏘드를 사용한다.
If your application requires a specific minimum version of the Android platform, or is designed only to support a certain range of Android platform versions, you can specify those version requirements as API Level identifiers in the application's manifest file. Doing so ensures that your application can only be installed on devices that are running a compatible version of the Android system.
여러분의 애플리케이션이 안드로이드 플랫폼의 특정 최소 버전을 요구하거나 특정 버전의 안드로이드 플랫폼 버전을 지원하도록만 설계되어 있다면, 여러분은 애플리케이션의 매니페스트 파일의 API Level 식별자를 사용하여 그 버전을 명시할 수 있다. 그렇게 하는 것은 여러분의 애플리케이션이 호환가능한 버전의 안드로이드 시스템을 실행하고 있는 디바이스에만 설치될 수 있다는 것을 보장한다.
To specify API Level requirements, add a <uses-sdk>
element in the application's manifest, with one or more of these attributes:
API 레벨 요구사항을 지정하기 위해, 아래와 같이 하나 또는 그 이상의 애트리뷰트를 이용하여 애플리케이션의 매니페스트에 <uses-sdk> 엘리먼트를 추가하라.
android:minSdkVersion The minimum version
of the Android platform on which the application will run, specified
by the platform's API Level identifier. 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.android:maxSdkVersion The maximum version
of the Android platform on which the application is designed to run,
specified by the platform's API Level identifier. Important: Please read the <uses-sdk>
documentation before using this attribute. When preparing to install your application, the system checks the value of this
attribute and compares it to the system version. If the
android:minSdkVersion value is greater than the system version, the
system aborts the installation of the application. Similarly, the system
installs your application only if its android:maxSdkVersion
is compatible with the platform version.
애플리케이션을 설치하려고 준비할 때, 시스템은 이 애트리뷰트 값을 확인해서 그것을 시스템 버전과 비교한다. android:minSdkVersion 값이 시스템 버전보다 높다면 시스템은 애플리케이션 설치를 중단한다. 비슷하게, android: maxSdkVersion이 플랫폼 버전과 호환가능하면 시스템은 여러분의 애플리케이션을 설치할 것이다.
If you do not specify these attributes in your manifest, the system assumes that your application is compatible with all platform versions, with no maximum API Level.
만약 여러분의 매니페스트에 이 애트리뷰트를 지정하지 않는다면, 시스템은 여러분의 애플리케이션이 최대 API 레벨없이 모든 플랫폼 버전과 호환된다고 가정한다.
To specify a minimum platform version for your application, add a
<uses-sdk> element as a child of
<manifest>, then define the
android:minSdkVersion as an attribute.
애플리케이션의 최소 플랫폼 버전을 지정하기 위해서는, <manifest>의 자식child에 <uses-sdk> 엘리먼트를 추가하라. 그리고 나서 애트리뷰트로 android: minSdkVersion을 정의하라.
For more information, see the <uses-sdk>
manifest element documentation and the API Levels document.
더 많은 정보를 위해서는, <uses-sdk> 매니페스트 엘리먼트 문서와 API 레벨 문서를 보라.