티스토리 뷰

처음에 참 헷갈리는 개념인것 같습니다.

그렇지만 그냥 아주 쉬운 개념이라고 생각하면 될것 같습니다.


간단한 개념이니 가볍게 보고 넘어가주세요.


음... 개발을 하다보면 다음과 같은 부분을 보게 됩니다.


1
2
minSdkVersion 15
targetSdkVersion 27
cs


1. minSdkVersion


쉽게 이야기 하면 이 앱을 사용할수 있는 단말의 최소 버전입니다.

뭐 이것까지는 쉽습니다.


2. 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).

As Android evolves with each new version, some behaviors and even appearances might change. However, if the API level of the platform is higher than the version declared by your app's targetSdkVersion, the system may enable compatibility behaviors to ensure that your app continues to work the way you expect. You can disable such compatibility behaviors by specifying targetSdkVersion to match the API level of the platform on which it's running. For example, setting this value to "11" or higher allows the system to apply a new default theme (Holo) to your app when running on Android 3.0 or higher and also disables screen compatibility mode when running on larger screens (because support for API level 11 implicitly supports larger screens).

There are many compatibility behaviors that the system may enable based on the value you set for this attribute. Several of these behaviors are described by the corresponding platform versions in the Build.VERSION_CODES reference.

To maintain your application along with each Android release, you should increase the value of this attribute to match the latest API level, then thoroughly test your application on the corresponding platform version.

Introduced in: API Level 4


한국어로 해볼까요?


애플리케이션의 대상 API 레벨을 지정하는 정수입니다. 설정하지 않을 경우 기본값은 minSdkVersion에 주어진 값과 동일합니다.

이 특성은 개발자가 대상 버전을 테스트했고 시스템이 향후 앱의 대상 버전과의 호환성을 유지하도록 호환성 동작을 활성화해서는 안 됨을 시스템에 알립니다. 여전히 애플리케이션을 이전 버전(minSdkVersion까지)에서 실행할 수 있습니다.

Android는 각 새 버전과 함께 진화하므로 몇몇 동작과 심지어 모양이 변경될 수 있습니다. 그러나 플랫폼의 API 레벨이 앱의 targetSdkVersion이 선언한 버전보다 높은 경우 시스템은 앱이 예상대로 계속 작동하도록 호환성 동작을 활성화할 수 있습니다. 실행 중인 플랫폼의 API 레벨과 일치하는 targetSdkVersion을 지정하여 그러한 호환성 동작을 비활성화할 수 있습니다. 예를 들어, 해당 값을 "11" 이상으로 설정하면 Android 3.0 이상에서 실행 중일 때 시스템이 새 기본 테마(Holo)를 앱에 적용할 수 있으며 대형 화면에서 실행 중일 때 (API 레벨 11에 대한 지원이 대형 화면을 암시적으로 지원하므로) 화면 호환성 모드를 비활성화합니다.

이 특성에 대해 설정한 값에 기반하여 시스템이 활성화할 수 있는 호환성 동작이 많이 있습니다. Build.VERSION_CODES 참조에서 해당 플랫폼 버전별로 이러한 몇몇 동작에 대해 설명합니다.

애플리케이션을 각 Android 릴리스와 함께 유지 관리하려면 최신 API 레벨과 일치하도록 이 특성 값을 높인 후에 해당 플랫폼 버전에서 애플리케이션을 철저히 테스트해야 합니다.

도입: API 레벨 4  


그냥 쉽게 이야기를 해보면


디바이스는 최신버전으로 변경이 되면서 개발된 버전이 최신 OS에서는 정상적으로 동작을 할 수 없을수도 있습니다. 예를 들어서 이전에는 동작하던것이 최신버전에서는 사라진 method이거나 하는 경우이죠. 이러한 경우에는 예상치 못하게 앱이 종료가 되는 문제가 발생하게 되고 이렇게 된다면 개발하는 사람들의 입장에서는 좋은 경우가 아니겠죠.


그래서 " 최종적으로 우리가 호환성을 맞춘 버전이 이 버전이다 " 라고 정의를 하여두는것입니다.


아는 분들은 아시겠지만 이 버전을 맞추지 않다보니까 권한 접근에 대한 부분들도 받지 않고 그냥 넘어가도 되는 문제들과 최하의 버전으로 개발을 하는 모습들이 보여서 얼마전에 구글쪽에서 강제로 앱들의 target버전을 한번에 올리도록 한적이 있죠.


명시는 하여두고 최신버전에서 정상적으로 동작하는지를 테스트하고 최신버전으로 맞추는게 좋을것 같습니다.

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함