๐ŸŽฏ Android SDK ๋ฒ„์ „ ์„ค์ •๊ณผ ํ˜ธํ™˜์„ฑ ๋ชจ๋“œ (compileSdkVersion, targetSdkVersion, minSdkVersion)

sery270ยท2021๋…„ 5์›” 2์ผ
4

Android

๋ชฉ๋ก ๋ณด๊ธฐ
9/13

์•ˆ๋…•ํ•˜์„ธ์š” ! ์˜ค๋Š˜์€ compileSdkVersion, targetSdkVersion, minSdkVersion๊ฐ€ ๋ฌด์—‡์ธ์ง€, ํ˜ธํ™˜์„ฑ ๋ชจ๋“œ๋ž€ ์–ด๋–ป๊ฒŒ ์ž‘๋™ํ•˜๋Š”์ง€ ์•Œ์•„๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ๊ถŒ์žฅ ์„ค์ • ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„œ๋„ ์ด์•ผ๊ธฐ ํ•ด๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿผ ์˜ค๋Š˜๋„ ํ™”์ดํŒ… ํ•ฉ์‹œ๋‹ค ๐ŸŒฟ

manifestํŒŒ์ผ์˜ Gradle์˜ android ๋ธ”๋ก

manifestํŒŒ์ผ์˜ ๋‚˜ Gradle์˜ android ๋ธ”๋ก ๋‚ด์—์„œ, compileSdkVersion, targetSdkVersion, minSdkVersion์™€ ๊ฐ™์€ ์†์„ฑ์„ ๋ณธ์ ์ด ์žˆ์„ํ…๋ฐ์š”. ์™œ ์ด๋Ÿฐ ๋ฒ„์ „์„ ์„ค์ •ํ•ด์ฃผ์–ด์•ผํ• ๊นŒ์š”?

๊ทธ ์ด์œ ๋Š” ์—ฌ๋Ÿฌ Android ๊ธฐ๊ธฐ๋งˆ๋‹ค Android ์‹œ์Šคํ…œ์ด ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š” Android ํ”„๋ ˆ์ž„์›Œํฌ API ๋ ˆ๋ฒจ(์ดํ•˜ API ๋ ˆ๋ฒจ)์ด ๋‹ค๋ฅผ ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

Android SDK์™€ Android API

Android SDK๋ž€ 'Android Software Development Kit'์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ์ฆ‰ Android ๊ฐœ๋ฐœ์ž๋ฅผ ์œ„ํ•œ ์ข…ํ•ฉ ์„ ๋ฌผ ์„ธํŠธ๋กœ, Android ๊ฐœ๋ฐœ์— ํ•„์š”ํ•œ ๋„๊ตฌ ์ƒ์ž๋ฅผ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ์ด Android SDK๋Š” Android API, Android ๊ฐœ๋ฐœ Tools, sample codes, develop document ๋“ฑ๋“ฑ์ด ํฌํ•จํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

์ฆ‰, ์œ„์—์„œ ์–ธ๊ธ‰ํ•œ "Android ํ”„๋ ˆ์ž„์›Œํฌ API ๋ ˆ๋ฒจ"์€ Android SDK์— ์†ํ•œ Android API์ž…๋‹ˆ๋‹ค.

๋”ฐ๋ผ์„œ ๊ฐœ๋ฐœ์ž๊ฐ€ ์‚ฌ์šฉํ•˜๋Š” compileSdkVersion, targetSdkVersion, minSdkVersion ์—” sdk๋กœ ๋ถˆ๋ฆฌ๋ฉฐ, ์‚ฌ์šฉ์ž๊ฐ€ ์‚ฌ์šฉํ•˜๋Š” ๊ธฐ๊ธฐ์— ๋Œ€ํ•ด์„ , API ๋ ˆ๋ฒจ์ด๋ผ๋Š” ๋ง๋กœ ๋ถˆ๋ฆฌ๊ฒŒ ๋˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

๊ธฐ๋ณธ์ ์œผ๋กœ Android ํ”Œ๋žซํผ์€ Android ํ”„๋ ˆ์ž„์›Œํฌ API๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ Android ํ”Œ๋žซํผ์€ ๊ณ„์†ํ•ด์„œ ๋ฐœ์ „ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๊ณ„์†ํ•ด์„œ ๋ฐœ์ „ํ•˜๋Š” Android ํ”Œ๋žซํผ์˜ ํŠน์„ฑ์ƒ, Android ํ”„๋ ˆ์ž„์›Œํฌ API ์—…๋ฐ์ดํŠธ๋Š” ์ƒˆ API๊ฐ€ ์ด์ „ API ๋ฒ„์ „๊ณผ์˜ ํ˜ธํ™˜์„ฑ์„ ์œ ์ง€ํ•˜๋„๋ก ๊ณ ์•ˆ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

์ด ๋ง์€ ์ด์ „ API๊ฐ€ ์‚ญ์ œ๋˜์–ด ์ƒˆ API๊ฐ€ ๋ชจ๋“ ๊ฒƒ์„ ๋Œ€์ฒด ํ•˜์ง€๋Š” ์•Š๋Š”๋‹ค๋Š” ์˜๋ฏธ์ด๋ฉฐ, ์ƒˆ API์™€ ์ด์ „ API๊ฐ€ ๊ฐ๊ฐ ๊ณ ์œ ํ•œ API๋กœ ๊ณต์กดํ•˜๋ฉฐ ๊ด€๋ฆฌ๋˜๊ณ  ์žˆ๋‹ค๋Š” ์˜๋ฏธ์ž…๋‹ˆ๋‹ค. "๊ณ ์œ ํ•œ API"๋ฅผ ํ‘œํ˜„ํ•˜๊ธฐ ์œ„ํ•ด ๊ฐ๊ฐ์˜ Android ํ”„๋ ˆ์ž„์›Œํฌ API๋Š” ์ •์ˆ˜๋กœ ํ‘œํ˜„๋˜๋Š” API ๋ ˆ๋ฒจ์„ ๊ฐ€์ง€๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ์ด API ๋ ˆ๋ฒจ์€ Android ํ”„๋ ˆ์ž„์›Œํฌ API๊ฐ€ ์—…๋ฐ์ดํŠธ ๋ ๋•Œ ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ Android ํ”Œ๋žซํผ ์—…๋ฐ์ดํŠธ์‹œ์—๋„, ๊ณ ์œ ํ•œ API ๋ ˆ๋ฒจ์„ ๊ฐ€์ง€๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

๋‹ค์‹œ SdkVersion์„ ์„ค์ •ํ•ด์ฃผ์–ด์•ผํ•˜๋Š” ์ด์•ผ๊ธฐ๋กœ ๋Œ์•„์˜ค๊ฒ ์Šต๋‹ˆ๋‹ค. ์•ž์„œ ๊ฐ ๊ธฐ๊ธฐ๊ฐ€ ์‚ฌ์šฉํ•˜๋Š” API ๋ ˆ๋ฒจ์ด ๋‹ค๋ฅผ ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์ด๋ผ๊ณ  ์–ธ๊ธ‰ํ–ˆ์Šต๋‹ˆ๋‹ค. ํ•˜๋‚˜์˜ ์•ฑ์€ ์—ฌ๋Ÿฌ ๊ธฐ๊ธฐ๋ฅผ ๋Œ€์ƒ์œผ๋กœ ๋งŒ๋“ค์–ด์ง‘๋‹ˆ๋‹ค. ์ฆ‰, ํ•˜๋‚˜์˜ ์•ฑ์€ ์—ฌ๋Ÿฌ API ๋ ˆ๋ฒจ์„ ๋Œ€์ƒ์œผ๋กœ ํ•˜๊ณ  ์žˆ๋‹ค๋Š” ์˜๋ฏธ์ž…๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ํ˜„์žฌ ์ง€๊ตฌ ์‚ฌ๋žŒ๋“ค์ด ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š” ๋ชจ๋“  Android ๊ธฐ๊ธฐ์˜ API ๋ ˆ๋ฒจ์„ ๋Œ€์ƒ์œผ๋กœ ์•ฑ์„ ์ œ์ž‘ํ•˜๋Š”๊ฒƒ์€ ๋งค์šฐ ํž˜๋“ ์ผ์ด๊ฑฐ๋‚˜, ๋งค์šฐ ์˜›๋‚ ์˜ API๋ฅผ ์‚ฌ์šฉํ•ด์•ผํ•  ๊ฒƒ ์ž…๋‹ˆ๋‹ค. ํ›„์ž์˜ ๊ฒฝ์šฐ, API 1 ๋ ˆ๋ฒจ์„ ๊ธฐ์ค€์œผ๋กœ ๋งŒ๋“ค์–ด์ง„ ์•ฑ์€, ๋ฐœ์ „ํ•˜๋Š” Android ํ”Œ๋žซํผ์— ๊ธฐ๋Œ€ํ•˜๋Š” ์‚ฌ์šฉ์ž๋ฅผ ๋งŒ์กฑ์‹œํ‚ค๊ธฐ ์–ด๋ ค์šธ ๊ฒƒ ์ž…๋‹ˆ๋‹ค. ๊ฐ API ๋ ˆ๋ฒจ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ธฐ๊ธฐ์˜ ํŠน์„ฑ(API 1์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š” ๊ธฐ๊ธฐ๋Š” ์•„์ฃผ์•„์ฃผ ์˜ค๋ž˜๋œ ๊ธฐ๊ธฐ์ผ ๊ฐ€๋Šฅ์„ฑ์ด ๋†’๋‹ค)์„ ๊ณ ๋ คํ•œ ์ ์ ˆํ•œ ํ•„ํ„ฐ๋ง์ด ํ•„์š”ํ•˜๋ฉฐ, ์ƒˆ API์˜ ์ตœ์‹  ๊ธฐ๋Šฅ ํ™œ์šฉํ•˜๊ธฐ ์œ„ํ•œ API ๋ ˆ๋ฒจ ์„ ํƒ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์ง€๊ธˆ ๋งŒ๋“ค๊ณ  ์žˆ๋Š” ์•ฑ์ด ์–ด๋–ค API ๋ ˆ๋ฒจ์„ ๊ธฐ์ค€์œผ๋กœ ๋งŒ๋“ค์–ด์กŒ์œผ๋ฉฐ, ์–ด๋–ค API ๋ ˆ๋ฒจ๋กœ ์ปดํŒŒ์ผ ๋˜์–ด์žˆ๋Š”์ง€, ์ด ์•ฑ์ด ๋™์ž‘ํ•˜์ง€ ์•Š๋Š” API ๋ ˆ๋ฒจ์ด ์žˆ๋Š”์ง€์— ๋Œ€ํ•ด ๋ช…์‹œํ•ด๋‘˜ ํ•„์š”๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ ๋งํ•˜๋Š” ๋ช…์‹œ๊ฐ€ ๋ฐ”๋กœ compileSdkVersion, targetSdkVersion, minSdkVersion์ธ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

#๏ธโƒฃ Reference


https://developer.android.com/guide/topics/manifest/uses-sdk-element?hl=ko#fc

https://developer.android.com/studio/projects#modules

https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/DefaultConfig

https://google.github.io/android-gradle-dsl/3.3/com.android.build.gradle.BaseExtension.html#com.android.build.gradle.BaseExtension:defaultConfig(org.gradle.api.Action)

profile
๊ฐœ๋ฐœ์„ธ๋ฆฌ์˜ ์„ฑ์žฅ๊ธฐ๐ŸŒฟ

0๊ฐœ์˜ ๋Œ“๊ธ€