๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ

(377)
[Kotlin] Obejct๋กœ ์„ ์–ธํ•œ Singleton ๊ฐ์ฒด์˜ ์ƒ์„ฑ์€ Lazy ํ•œ๊ฐ€? Java๋กœ ์ž‘์„ฑ๋œ ์ฝ”๋“œ๋ฅผ Kotlin์œผ๋กœ ์ž‘์„ฑํ•˜๋‹ค๊ฐ€ ๋“  ์˜๋ฌธ์œผ๋กœ ์‹œ์ž‘ํ•จ. Java์—์„œ Singleton ํŒจํ„ด์œผ๋กœ ์ž‘์„ฑ๋œ ํด๋ž˜์Šค๋“ค์€, ํ˜ธ์ถœ ์‹œ instance๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๊ณ , instatnce๊ฐ€ ์—†์„ ๊ฒฝ์šฐ ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•˜๋Š” ๊ฒƒ์„ ์ž์ฃผ ๋ด์™”๋‹ค. Kotlin์—์„œ object๋กœ ์„ ์–ธํ•ด ์ž‘์„ฑํ•˜๋ฉด singleton ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•œ๋‹ค๊ณ  ์•Œ๊ณ  ์žˆ์–ด์„œ, ์ •๋ง ํŽธ๋ฆฌํ•˜๊ฒŒ object ํ‚ค์›Œ๋“œ๋ฅผ ์“ฐ๋ฉฐ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๊ณ  ์žˆ์—ˆ๋Š”๋ฐ, java ์ฝ”๋“œ์—์„œ ์ž‘์„ฑํ•œ singleton ํŒจํ„ด๊ณผ ์ •๋ง ๋™์ผํ•˜๊ฒŒ ๋™์ž‘ํ•˜๋Š”๊ฒŒ ๋งž๊ฒ ์ง€?๋ผ๋Š” ์˜๋ฌธ์ด ๋“ค์—ˆ๋‹ค. ํ™•์ธ ๋“ค์–ด๊ฐ„๋‹ค. ๊ฒฐ๋ก  > ๊ณต์‹๋ฌธ์„œ ์ƒ์— ๋”ฐ๋ฅด๋ฉด ๊ทธ๋Ÿฌํ•˜๋‹ค. ๊ณต์‹๋ฌธ์„œ์˜ ์–ธ๊ธ‰์„ ์ฐพ์•„๋ณธ๋‹ค. https://kotlinlang.org/docs/object-declarations.html#object-decl..
[Network] HTTP headers ๊ธฐ์ ์„ ๋ถ€๋ฅด๋Š” ์•ˆ๋“œ๋กœ์ด๋“œ ํ†ต์‹  ํ”„๋กœ๊ทธ๋ž˜๋ฐ ๊ธฐ์ ์„ ๋ถ€๋ฅด๋Š” ์•ˆ๋“œ๋กœ์ด๋“œ ํ†ต์‹  ํ”„๋กœ๊ทธ๋ž˜๋ฐ - YES24 ์•ˆ๋“œ๋กœ์ด๋“œ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์•ˆ๋‚ด์„œ. ์•ˆ๋“œ๋กœ์ด๋“œ๊ฐ€ ์ œ๊ณตํ•˜๋Š” ๊ธฐ๋Šฅ๋“ค์— ๊ตญํ•œํ•˜์ง€ ์•Š๊ณ  ๋‹ค์–‘ํ•œ ์—…์ฒด์—์„œ ์ œ๊ณตํ•˜๋Š” ํŒจํ‚ค์ง€์™€ ํ†ต์‹  ํ”„๋กœํ† ์ฝœ ๊ทธ๋ฆฌ๊ณ  ์ž๋ฐ”์˜ ๊ณ ์œ  ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜์—ฌ ํ†ต์‹ ์˜ ์ „๋ฐ˜์ ์ธ ๊ธฐ๋Šฅ www.yes24.com https://www.blog-dreamus.com/post/cache-control-%EC%9D%B4-%ED%95%84%EC%9A%94%ED%95%9C-%EC%9D%B4%EC%9C%A0 'Cache-Control'์ด ํ•„์š”ํ•œ ์ด์œ  ์•ฑ์˜ ์„ฑ๋Šฅ์„ ํ–ฅ์ƒ์‹œํ‚ค๋Š” ๋ฐฉ๋ฒ• ์ค‘ ํ•˜๋‚˜์ธ ์บ์‹œ. ํด๋ผ์ด์–ธํŠธ์—์„œ ์บ์‰ฌ๋ฅผ ํ•˜๊ณ , ์„œ๋ฒ„์—์„œ ์ปจํŠธ๋กค์ด ๊ฐ€๋Šฅํ•œ Cache-Control์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ด…๋‹ˆ๋‹ค. www.blog-dreamus.c..
[Kotlin][Java] ByteArrays๋ฅผ 16์ง„์ˆ˜(Hex) String์œผ๋กœ ๋ณ€ํ™˜ https://www.baeldung.com/kotlin/byte-arrays-to-hex-strings ์—ฌ๊ธฐ์— ์ •๋ง ์ž˜ ๋‚˜์™”์Œ. ๋‹ค์–‘ํ•œ ๋ฐฉ๋ฒ•์ด ์กด์žฌํ–ˆ๋‹ค. ๊ทธ ์ค‘์—์„œ ๋‹ค์Œ์˜ ๋ฐฉ๋ฒ•์— ์ฃผ๋ชฉํ–ˆ๋‹ค. https://www.baeldung.com/kotlin/byte-arrays-to-hex-strings val hexChars = "0123456789abcdef".toCharArray() fun ByteArray.toHex4(): String { val hex = CharArray(2 * this.size) this.forEachIndexed { i, byte -> val unsigned = 0xff and byte.toInt() hex[2 * i] = hexChars[unsigned / 16] hex[2 * i..
[Android][Java][์•”ํ˜ธํ™”] MessageDigest https://developer.android.com/reference/kotlin/java/security/MessageDigest MessageDigest | Android Developers developer.android.com MessageDigest ํด๋ž˜์Šค๋Š” message digest algorithm ๊ธฐ๋Šฅ(SHA-1, SHA-256 ๋“ฑ)์„ ์•ฑ์— ์ œ๊ณตํ•œ๋‹ค. Message digest๋Š” ์ž„์˜์˜ ํฌ๊ธฐ์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์†Œ์ •๋œ ๊ธธ์ด์˜ ํ•ด์‹œ ๊ฐ’์œผ๋กœ ์ถœ๋ ฅํ•˜๋Š” ์•ˆ์ „ํ•œ ๋‹จ๋ฐฉํ–ฅ ํ•ด์‹œ ํ•จ์ˆ˜์ด๋‹ค. Q. message digest algorithm์ด ๋ฌด์—‡์ธ๊ฐ€? https://www.geeksforgeeks.org/what-is-the-md5-algorithm/ What is the MD5 Algorithm? - Geek..
[Android][Compose][์‚ฝ์งˆ ๊ตํ›ˆ] Compose Migration + Expandable List ์‹œ์ž‘ ๊ธฐ์กด ํ”„๋กœ์ ํŠธ๋Š” ์•„์ง๋„ deprecated ๋œ jcenter repository์˜ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋“ค์„ ์“ฐ๊ณ  ์žˆ๋‹ค. Gradle 8.0์˜ ๊ธฐ๋Šฅ์„ ์˜จ์ „ํžˆ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ์ € jcenter์— ๋ฌผ๋ฆฐ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋“ค์„ ๊ต์ฒดํ•ด์•ผ ํ•œ๋‹ค. ๊ต์ฒด ๋Œ€์ƒ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ค‘ ExpandedRecyclerView๋ฅผ ์ œ๊ณตํ•˜๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์žˆ๋‹ค. ์•ฑ์—์„œ ๋งŽ์ด ์“ฐ์ด๋Š” ๊ธฐ๋Šฅ๋„ ์•„๋‹ˆ๊ณ , ์•ฝ๊ด€ ์„ค๋ช…์„ ์œ„ํ•ด ๊ฐ„๋‹จํžˆ ์“ฐ์ด๋Š” ๊ฒƒ ๋ฟ์ด๋ผ์„œ ์ง์ ‘ ๋งŒ๋“ค๊ธฐ๋กœ ํ–ˆ๋‹ค. Compose๋กœ ๋งŒ๋“œ๋Š” ๊ฒŒ ๋” ๊ฐ„๋‹จํ•  ๊ฒƒ ๊ฐ™์•„์„œ ์‹œ์ž‘ํ–ˆ๋‹ค. Gradle ์„ค์ • ์ฐธ๊ณ  : https://velog.io/@blucky8649/Android-%EA%B8%B0%EC%A1%B4-%EC%95%B1%EC%97%90-Compose-UI-%EC%A0%81%EC%9A%A9-%EC%8B%9C%E..
[Android][View] decor view ๊ณต์‹ ๋ ˆํผ๋Ÿฐ์Šค ๋ฌธ์„œ์—์„œ์˜ ๋“ฑ์žฅ https://developer.android.com/reference/android/view/Window#getDecorView() Window | Android Developers developer.android.com Window์˜ getDecorView()๋กœ ๋ฐ˜ํ™˜๋˜๋Š” ๊ฐ์ฒด. public abstract View getDecorView() Returns the top-level window decor view. This value cannot be null. ๋ฐœ๋ฒˆ์—ญ ์ตœ์ƒ๋‹จ ์œˆ๋„์šฐ decor view๋ฅผ ๋ฐ˜ํ™˜ํ•จ. null์„ ๋ฐ˜ํ™˜ํ•  ์ˆ˜ ์—†์Œ. Retrieve the top-level window decor view (containing the standard window f..
[Android][Lint] Missing baselineAligned attribute ์‹œ์ž‘ Lint ๊ฒฝ๊ณ  ํ™•์ธ ์ค‘ ํ•ด๋‹น ๊ฒฝ๊ณ ๋ฅผ ํ™•์ธํ–ˆ๋‹ค. ๊ด€๋ จ ์„ค๋ช…์€ ์ด๋Ÿฌํ•˜๋‹ค. Set android:baselineAligned="false" on this element for better performance ๋ฐœ๋ฒˆ์—ญ ์ด ์š”์†Œ์˜ ์„ฑ๋Šฅ ๊ฐœ์„ ์„ ์œ„ํ•ด android:baselineAligned="false" ๋กœ ์„ค์ •ํ•˜์‹œ์˜ค. ์‚ดํŽด๋ณด๋‹ˆ ์ด ๊ฒฝ๊ณ ๊ฐ€ ๋œจ๋Š” ๋ถ€๋ถ„๋“ค์€ LinearLayout๋“ค์ด๋‹ค. When a LinearLayout is used to distribute the space proportionally between nested layouts, the baseline alignment property should be turned off to make the layout computation faster. ๋ฐœ..
[Android][WebView] cannot find symbol method setAppCacheEnabled(boolean) ์‹œ์ž‘. ์ด์Šˆ ํ™•์ธ target version์ด 31์ธ ํ”„๋กœ์ ํŠธ์˜ target version์„ 33์œผ๋กœ ์ˆ˜์ •ํ–ˆ๋‹ค. ๊ทธ ํ›„ cannot find symbol method setAppCacheEnabled(boolean) ๋ผ๋Š” ๋นŒ๋“œ ์—๋Ÿฌ๋ฅผ ํ™•์ธํ–ˆ๋‹ค. ์‚ดํŽด๋ณด๋‹ˆ ๊ธฐ์กด์— ์ž˜ ์“ฐ๋˜ ์ฝ”๋“œ๋ฅผ IDE์—์„œ ํ‰์†Œ์™€๋Š” ๋‹ค๋ฅด๊ฒŒ ๋ณด์—ฌ์ฃผ๊ณ  ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ํ™•์ธํ–ˆ๋‹ค. ๋‚ด๋ถ€ ์ฝ”๋“œ ํ™•์ธ WetSettings์˜ ๋‚ด๋ถ€ ์ฝ”๋“œ๋ฅผ ํ™•์ธํ•œ๋‹ค. target version์ด 31์ผ ๋•Œ์—๋Š” Control ํ‚ค + ๋งˆ์šฐ์Šค ํด๋ฆญ์œผ๋กœ ๋‚ด๋ถ€ ์ฝ”๋“œ๋กœ์˜ ์ด๋™์ด ๊ฐ€๋Šฅํ–ˆ๋Š”๋ฐ, target version์ด 33์ผ ๋•Œ์—๋Š” ์ด ๋ฐฉ๋ฒ•์œผ๋กœ ๋‚ด๋ถ€ ์ฝ”๋“œ๋กœ์˜ ์ด๋™์ด ๋ถˆ๊ฐ€ํ–ˆ๋‹ค. WebSettings ํด๋ž˜์Šค ์ฝ”๋“œ๋ฅผ ์ฐพ์•„๋‚˜์…”์„œ target version์ด 33์ผ ๋•Œ์˜ ํ•ด๋‹น ์ฝ”๋“œ์˜ ๋‚ด๋ถ€ ์ฝ”๋“œ๋ฅผ..