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

๊ณณ๊ฐ„์—์„œ ์ธ์‹ฌ๋‚œ๋‹ค

(31)
[Android]์•ฑ ๋นŒ๋“œ ์„ค์ • - zero base ํ”„๋กœ์ ํŠธ ๊ฐœ๋ฐœ ์‹œ ๋‚ด์šฉ ์ •๋ฆฌ์˜ ํ•„์š”์„ฑ์„ ๋Š๋‚€ ๊ฒƒ๋“ค ์ฐธ๊ณ  https://stackoverflow.com/a/36455983 https://developer.android.com/studio/publish/app-signing?hl=ko#secure-shared-keystore ๋ฌธ์„œ ์ž‘์„ฑ ํ•„์š”์„ฑ ๊ธ‰ํ•˜๊ฒŒ zero base ํ”„๋กœ์ ํŠธ๋ฅผ ๋„˜๊ฒจ๋ฐ›์•„์„œ ์ผ์„ ํ–ˆ์—ˆ์Œ. ์ด๊ฒƒ ์ €๊ฒƒ ๋นŒ๋“œ ๊ด€๋ จํ•ด์„œ ์„ค์ • ํ•ด์•ผํ•˜๋Š” ๊ฑด ์•„๋Š”๋ฐ ๊ตฌ์ฒด์ ์ธ ๋ฐฉ๋ฒ•๋“ค์€ ํ™•์‹คํ•˜๊ฒŒ ์ƒ๊ฐ์ด ๋‚˜์ง€ ์•Š์•„ ๋‹ค ๊ฒ€์ƒ‰ํ•˜๋ฉฐ ์ฐพ์•„์•ผ ํ–ˆ์Œ. ์ด๋ฒˆ์— ์ •๋ฆฌํ•ด์„œ ๋‹ค์Œ ๋ฒˆ์— ๋ˆ„๋ฝ ์‚ฌํ•ญ ์—†์ด, ๋œ ํ—ค๋งค๋ฉด์„œ ๋น ๋ฅด๊ฒŒ ์ž‘์—…ํ•˜๊ธฐ ์œ„ํ•ด ๊ธฐ๋กํ•จ. ๊ธฐ๋ก ๋Œ€์ƒ apk, aab ํŒŒ์ผ ์ด๋ฆ„ ์ž๋™ ์ƒ์„ฑ flavor/type ๋ณ„ ์„ค์ • flavor/type ๋ณ„ ์‚ฌ์ด๋‹ ํ‚ค ์ž๋™ ์„ค์ • flavor/type ๋ณ„ ์•ฑ ์ด๋ฆ„ ์ž๋™ ์„ค์ • ๋ฆด๋ฆฌ์ฆˆ ๋ฒ„์ „ ์„ค์ • buildF..
[Android][Animation] 2์ดˆ๋งˆ๋‹ค ๊นœ๋นก์ด๋Š” ์• ๋‹ˆ๋ฉ”์ด์…˜. ์ดˆ๊ฐ„๋‹จ ๊ตฌํ˜„ https://developer.android.com/develop/ui/views/animations/prop-animation#choreography
[Android] Swipe ์ œ์Šค์ณ ๊ฐ์ง€ CustomView GestureDetector ์ด์šฉ https://stackoverflow.com/a/19506010 Android: How to handle right to left swipe gestures I want my app to recognize when a user swipes from right to left on the phone screen. How to do this? stackoverflow.com GestureDetector์˜ onFling()์ด ํ˜ธ์ถœ๋˜์ง€ ์•Š์„ ๊ฒฝ์šฐ https://stackoverflow.com/a/17833241 onfling() not being called for some reason I'm trying to implement gesture in my app and for s..
[Kotlin] ํ–‰๋ ฌ์˜ ๊ณฑ https://ko.wikipedia.org/wiki/%ED%96%89%EB%A0%AC_%EA%B3%B1%EC%85%88 ํ–‰๋ ฌ ๊ณฑ์…ˆ - ์œ„ํ‚ค๋ฐฑ๊ณผ, ์šฐ๋ฆฌ ๋ชจ๋‘์˜ ๋ฐฑ๊ณผ์‚ฌ์ „ ์œ„ํ‚ค๋ฐฑ๊ณผ, ์šฐ๋ฆฌ ๋ชจ๋‘์˜ ๋ฐฑ๊ณผ์‚ฌ์ „. ํ–‰๋ ฌ ๊ณฑ์…ˆ์„ ์œ„ํ•ด์„  ์ฒซ์งธ ํ–‰๋ ฌ์˜ ์—ด ๊ฐฏ์ˆ˜์™€ ๋‘˜์งธ ํ–‰๋ ฌ์˜ ํ–‰ ๊ฐฏ์ˆ˜๊ฐ€ ๋™์ผํ•ด์•ผํ•œ๋‹ค. ๊ณฑ์…ˆ์˜ ๊ฒฐ๊ณผ ์ƒˆ๋กญ๊ฒŒ ๋งŒ๋“ค์–ด์ง„ ํ–‰๋ ฌ์€ ์ฒซ์งธ ํ–‰๋ ฌ์˜ ํ–‰ ๊ฐฏ์ˆ˜์™€ ๋‘˜์งธ ํ–‰๋ ฌ์˜ ์—ด ko.wikipedia.org ํ–‰๋ ฌ A๋Š” a x b ํ–‰๋ ฌ, ํ–‰๋ ฌ B๋Š” b x cํ–‰๋ ฌ์ด๋ผ๊ณ  ํ•  ๋•Œ, ํ–‰๋ ฌ A์™€ ํ–‰๋ ฌ B์˜ ๊ณฑ์œผ๋กœ ๋‚˜์˜จ ํ–‰๋ ฌ C์˜ ์›์†Œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. fun matrixMultiply(arr1: Array, arr2: Array): Array { val (m1, m2) = if (arr1[0].size == arr2.size) { arr1..
[Kotlin] ์ตœ๋Œ€๊ณต์•ฝ์ˆ˜ & ์ตœ์†Œ๊ณต๋ฐฐ์ˆ˜ ๊ตฌํ•˜๊ธฐ ์ตœ๋Œ€๊ณต์•ฝ์ˆ˜ GCD(Greatest Common Divisor) ์œ ํด๋ฆฌ๋“œํ˜ธ์ œ๋ฒ• ์ด์šฉ fun gcd(num1: Int, num2: Int): Int { return if (num2 == 0) num1 else gcd(num2, num1 % num2) } ์ตœ์†Œ๊ณต๋ฐฐ์ˆ˜ LCM(Least Common Multiple) ์ตœ์†Œ๊ณต๋ฐฐ์ˆ˜ = ๋‘ ์ž์—ฐ์ˆ˜์˜ ๊ณฑ / ์ตœ๋Œ€๊ณต์•ฝ์ˆ˜ fun lcm(num1: Int, num2: Int): Int { return num1 * num2 / gcd(num1, num2) }
[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][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..
[์ž๋ฃŒ๊ตฌ์กฐ] ์—ฐ๊ฒฐ ๋ฆฌ์ŠคํŠธ ๋‹จ์ผ ์—ฐ๊ฒฐ ๋ฆฌ์ŠคํŠธ ๋…ธ๋“œ ๊ตฌ์„ฑ : ๋ฐ์ดํ„ฐ + link(๋‹ค์Œ ๋…ธ๋“œ์— ๋Œ€ํ•œ ์—ฐ๊ฒฐ ๊ณ ๋ฆฌ. ํฌ์ธํ„ฐ ํ˜น์€ ๋ ˆํผ๋Ÿฐ์Šค) ์ฒซ ๋ฒˆ ์งธ ๋…ธ๋“œ : ํ—ค๋” header ๋งˆ์ง€๋ง‰ ๋…ธ๋“œ : ๊ผฌ๋ฆฌ tail. link๋Š” ๋น„์›Œ๋‘๊ฑฐ๋‚˜ null๋กœ ์ง€์ •ํ•จ ๋…ธ๋“œ์˜ link๋Š” ๋‹ค์Œ ๋…ธ๋“œ๋ฅผ ๊ฐ€๋ฆฌํ‚ค๋Š” ํฌ์ธํŠธ๋‚˜ ๋ ˆํผ๋Ÿฐ์Šค๋กœ๋งŒ ๊ตฌ์„ฑ๋จ. ๊ทธ๋ž˜์„œ ์•ž์œผ๋กœ๋งŒ ์ข…์ฃผ ๊ฐ€๋Šฅ ๋ฆฌ์ŠคํŠธ๋ฅผ ์™„์ • ์ข…์ฃผํ•˜๋ ค๋ฉด ํ•ญ์ƒ ์ฒซ ๋ฒˆ์งธ ์›์†Œ๋ถ€ํ„ฐ ์‹œ์ž‘ํ•ด์•ผ ํ•œ๋‹ค. ๋ฆฌ์ŠคํŠธ์— ์žˆ๋Š” ๋ชจ๋“  ์›์†Œ์˜ ์œ„์น˜๋ฅผ ํŒŒ์•…ํ•˜๋ ค๋ฉด ๋ฆฌ์ŠคํŠธ์˜ ์ฒซ ๋ฒˆ์งธ ์›์†Œ์— ๋Œ€ํ•œ ํฌ์ธํ„ฐ๋‚˜ ๋ ˆํผ๋Ÿฐ์Šค๊ฐ€ ์žˆ์–ด์•ผ ํ•œ๋‹ค. ์ฒซ ๋ฒˆ์žฌ ์›์†Œ์˜ ํฌ์ธํ„ฐ๋‚˜ ๋ ˆํผ๋Ÿฐ์Šค๋Š” ๋ณดํ†ต ๋ณ„๋„์˜ ์ž๋ฃŒ๊ตฌ์กฐ์— ์ €์žฅํ•จ. ๋…ธ๋“œ. ์ฝ”ํ‹€๋ฆฐ์œผ๋กœ ์ž‘์„ฑ class SinglyLinkedListElement(val value: T, var next: SinglyLinkedListElemen..