Android 17

์•ˆ๋“œ๋กœ์ด๋“œ ๋ฐ์ดํ„ฐ ๋ฐ”์ธ๋”ฉ(Data Binding) ์‹œ์ž‘ํ•˜๊ธฐ

Data Binding ๋ฐ์ดํ„ฐ ๋ฐ”์ธ๋”ฉ(Data Binding)์„ ์จ์•ผํ•˜๋Š” ์ด์œ  ์•ˆ๋“œ๋กœ์ด๋“œ๋ฅผ ๋ฐฐ์šฐ๋Š” ์ดˆ๊ธฐ์—๋Š” findViewById()๋ฅผ ๋งŽ์ด ์“ด๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ findViewById()๋Š” runtime์‹œ ๋ทฐ์˜ ๊ณ„์ธต์„ ํƒ€๊ณ ํƒ€๊ณ  ๋“ค์–ด๊ฐ€๋Š” ๋น„ํšจ์œจ์ ์ธ ํ•จ์ˆ˜์ด๋‹ค. ๊ฐ„๋‹จํ•œ ์•ฑ์—์„œ๋Š” ์ƒ๊ด€์—†์ง€๋งŒ, ์•ฑ์ด ์ปค์ง€๋ฉด ํšจ์œจ์ด ๋–จ์–ด์ง„๋‹คใ…œใ…œ Data Binding์€ ๊ฐ ๋ ˆ์ด์•„์›ƒ xml๋งˆ๋‹ค binding class๋ฅผ ๋งŒ๋“ ๋‹ค. (activity_main ⇒ ActivityMainBinding) ๊ทธ๋ž˜์„œ binding class๋ฅผ ํ†ตํ•ด ์‰ฝ๊ฒŒ ๋ทฐ์— ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ์–ด์„œ, ์ฝ”๋“œ๋„ ๊ฐ„๊ฒฐํ•ด์ง„๋‹ค. ๋˜ํ•œ, ์š”์ฆ˜ ๋งŽ์ด ์“ฐ๋Š” MVVM ์•„ํ‚คํ…์ณ์—์„œ ์ฃผ๋กœ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์ด๋‹ค. ๋ฐ์ดํ„ฐ ๋ฐ”์ธ๋”ฉ(Data Binding)์˜ ์žฅ์  findViewById()์˜ ๋น„ํšจ์œจ์„ฑ์„ ๊ฐœ..

Android 2021.06.05

์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค Database Inspector์—์„œ DB๊ฐ€ ์•ˆ๋ณด์ผ ๋•Œ

๋ถ„๋ช… ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๊ฐ€ ์กด์žฌํ•จ์—๋„ ๋ถˆ๊ตฌํ•˜๊ณ , Database Inspector๋ฅผ ๋ˆ„๋ฅด๋ฉด ์ด๋ ‡๊ฒŒ ๋œฐ ๋•Œ๊ฐ€ ์žˆ๋‹ค. ํ•ด๊ฒฐ๋ฒ• ์•„์ฃผ ๊ฐ„๋‹จํ•จ . . . File -> Invalidate Caches/Restart ๋ฅผ ํ•˜๋ฉด ๋œ๋‹ค!!!!!! ๊ทธ๋Ÿฌ๊ณ  ๋‚˜์„œ ์•ฑ์„ ๋‹ค์‹œ ์‹คํ–‰ํ•˜๋ฉด, DB๊ฐ€ ์ž˜ ๋ณด์ž„!๐Ÿ˜†

Android 2021.06.04

์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค ํ”„๋กœ์ ํŠธ Java๋ฅผ Kotlin์œผ๋กœ ๋ณ€ํ™˜ (java kt๋กœ ๋ฐ”๊พธ๊ธฐ)

์‹ ๋‚˜๊ฒŒ ์ž‘์—…ํ•˜๊ณ  ์žˆ๋˜ ์–ด๋Š ๋‚  , , ๋ฌธ๋“ MainActivity๊ฐ€ Java๋กœ ๋˜์–ด์žˆ๋Š” ๊ฑธ ๊นจ๋‹ฌ์•˜๋‹ค. ์•Œ๊ณ  ๋ณด๋‹ˆ ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ ์‹œ ์ž๋ฐ”๋กœ ๋งŒ๋“ค์—ˆ๋˜ ๊ฒƒ,,,,, ๋‚˜๋จธ์ง€๋Š” ์ฝ”ํ‹€๋ฆฐ์œผ๋กœ ๋‹ค ์ž‘์—…ํ•ด๋†”์„œ ๋‹คํ–‰์ด์—ˆ์ง€๋งŒ, MainActivity๋งŒ Java๋กœ ๋˜์–ด์žˆ์–ด์„œ ์–ด๋–ป๊ฒŒ ํ•ด์•ผ ํ•˜๋‚˜ ํ•˜๊ณ  ์žˆ์—ˆ๋Š”๋ฐ, ์—ญ์‹œ ํ‚น๊ฐ“ํ‹€๋ฆฐ...๐Ÿ‘ MainActivity์—์„œ ์šฐํด๋ฆญํ•˜๋ฉด, Convert Java File to Kotlin File ์ด๋ผ๋Š” ๊ธฐ๋Šฅ์ด ์žˆ๋‹ค..! ํŒ์—…์ฐฝ์ด ๋œจ๋Š”๋ฐ ๊ทธ๋ƒฅ OK ๋ˆŒ๋Ÿฌ์ฃผ๋ฉด ๋œ๋‹ค. ๊ทธ๋Ÿฌ๋ฉด ์ž ์‹œ ํ›„... ์•„์ฃผ ๋‚˜์ด์Šค ํ•˜๊ฒŒ ์ฝ”ํ‹€๋ฆฐ์œผ๋กœ ๋ฐ”๋€๋‹ค!!!!!

Android 2021.05.28

Plugin [id: 'kotlin-android'] was not found in any of the following sources ์˜ค๋ฅ˜ ํ•ด๊ฒฐ

Plugin [id: 'kotlin-android'] was not found in any of the following sources Plugin [id: 'kotlin-kapt'] was not found in any of the following sources plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-kapt' } Room ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์“ฐ๋ ค๊ณ  plugin์— 'kotlin-android'์™€ 'kotlin-kapt'๋ฅผ ์ถ”๊ฐ€ํ•˜๋‹ˆ๊นŒ ์ด์™€ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋‚ฌ๋‹ค.๐Ÿ˜ข ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• Project ๋ ˆ๋ฒจ์˜ Gradle ํŒŒ์ผ๋กœ ๊ฐ„๋‹ค. Gradle ํŒŒ์ผ์— ์ž๊ธฐ์˜ ํ˜„์žฌ ์ฝ”ํ‹€๋ฆฐ ๋ฒ„์ „๊ณผ, classpath๋ฅผ ์ถ”๊ฐ€ํ•ด์ฃผ๋ฉด ๋œ๋‹ค! buildscript ..

Android 2021.05.23

์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค styles.xml ์—†์Œ

์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค๊ฐ€ ์—…๋ฐ์ดํŠธ๋ฅผ ํ•˜๋ฉด์„œ styles.xml๋Œ€์‹  themes.xml๋กœ ํŒŒ์ผ ์ด๋ฆ„์ด ๋ณ€๊ฒฝ๋˜์—ˆ๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ์ €์ฒ˜๋Ÿผ ํ—ค๋งค์ง€ ๋งˆ์‹œ๊ธธ....๐Ÿ˜‚

Android 2021.02.07

์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค 4.1์—์„œ ์œ„์ ฏ ์•„์ด๋”” ์ ‘๊ทผํ•˜๋Š” ๋ฒ•

์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค 4.1 ๋ฒ„์ „์—์„œ๋Š” ์œ„์ ฏ์— ์ ‘๊ทผํ•˜๊ธฐ ์œ„ํ•ด ์ˆ˜๋™์œผ๋กœ ์ฝ”ํ‹€๋ฆฐ ์ต์Šคํ…์…˜์„ ์ถ”๊ฐ€ํ•ด์•ผ ํ•œ๋‹ค. build.gradle(Module:ํ”„๋กœ์ ํŠธ์ด๋ฆ„.app) ํŒŒ์ผ ํด๋ฆญ. plugins { id 'com.android.application' id 'kotlin-android' // ์•„๋ž˜ ์ฝ”ํ‹€๋ฆฐ ์ต์Šคํ…์…˜์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. id 'kotlin-android-extensions' } ... id 'kotlin-android-extensions'๋ฅผ plugins ๋งจ ๋ฐ‘์— ์ถ”๊ฐ€ํ•˜์ž! (+) ์ถ”๊ฐ€ id๋ฅผ ์‚ฌ์šฉํ•˜๊ฒŒ ๋˜๋ฉด, ๋‹ค๋ฅธ ํ™”๋ฉด์˜ ๋ฒ„ํŠผ์ด๋‚˜ ํ…์ŠคํŠธ๋ทฐ๋ฅผ ๊ฐ€์ ธ์˜ค๊ฒŒ ๋˜๋Š” ์œ„ํ—˜์ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ์ฝ”ํ‹€๋ฆฐ ์ต์Šคํ…์…˜์€ ์—†์–ด์งˆ ๊ณ„ํš์ด๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค! ์œ„์ฒ˜๋Ÿผ id์— ์ง์ ‘ ์ ‘๊ทผํ•˜๋Š” ๋ฐฉ๋ฒ• ๋Œ€์‹  ๋ทฐ๋ฐ”์ธ๋”ฉ์„ ์“ฐ์‹ค ๊ฒƒ์„ ์ถ”์ฒœ!!!!! hyunjung..

Android 2021.02.07