일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 백준 2096
- Android Room
- Jetpack Room
- 자바
- 백준 10819
- 1806 투포인터
- 이진 탐색
- 10819 파이썬
- 자료구조
- 1003 파이썬
- 1753 다익스트라
- android hilt
- java
- 1806 백준
- 6588 파이썬
- 안드로이드 hilt
- flow buffering
- 코루틴 플로우
- 1644 파이썬
- 백준 1644
- Coroutine Flow
- 5582 파이썬
- 5582 DP
- 2096 파이썬
- 1806 파이썬
- 백준 5582
- git local remote
- 투포인터 알고리즘
- 1753 파이썬
- Android mvp
- Today
- Total
목록Kotlin (Android) (29)
Gemstone's Devlog
MVP 패턴이란? Model View Presenter 패턴은 MVC(Model View Controller) 패턴을 기반으로 하는 아키텍처 패턴으로 관심사의 분리를 높이고 단위 테스트를 용이하게 합니다. 요약 : MVC 패턴에서 View와 Model의 의존성을 없애고 단위 테스트가 어려웠던 문제점을 해결하기 위해 등장하게 된 패턴이라고 할 수 있습니다. Model 앱에 사용되는 데이터를 관리 담당하는 역할을 한다. 흔히 '비즈니스 로직'이라고 부르는 부분입니다. 모델에는 Network API, 데이터 캐싱, 데이터베이스 등이 포함되고, Repository Pattern을 사용하는 경우 Repository도 포함됩니다. View 사용자 인터페이스 영역이며, Activity, Fragment 등이 포함되고..
Sealed Class https://kotlinlang.org/docs/sealed-classes.html Sealed classes | Kotlin kotlinlang.org https://codechacha.com/ko/kotlin-sealed-classes/ Kotlin - Sealed class 구현 방법 및 예제 Sealed class는 Super class를 상속받는 Child 클래스의 종류 제한하는 특성을 갖고 있는 클래스입니다. Enum과의 차이점은 Enum은 single instance만 만들 수 있는 반면에 Sealed class는 여러개의 객체를 생성할 codechacha.com Generics Class https://kotlinlang.org/docs/generics.html#u..
운영체제 공부할 때 race condition과 비슷한 내용인 것 같다. 여러 쓰레드가 공유된 변수를 동시에 접근해서 프로세스를 진행할 때 race condition이 발생하게 되는데 코틀린에서도 다음과 같이 공유 변수 counter를 AtomicInteger로 선언해두면 이를 방지할 수가 있다.
https://kotlinlang.org/docs/flow.html#conflation Asynchronous Flow | Kotlin kotlinlang.org 위 공식 사이트에서 flow에 대해서 더욱 자세히 공부하다가 Buffering에 대해 정리하려고 한다. 내가 이해한 바로는 Flow는 cold이기 때문에 collect를 호출해야만 데이터 스트림이 방출되고, 처음에 buffer를 등록해두고 collect를 통해 flow 데이터를 수집하기 시작할 때, 처음 emit에서 100ms가 걸리고, 처음 프로세스에서 300ms 가 소요되는 동안 emit(2)와 emit(3)의 결과가 buffer에 저장되고, 처음 프로세스가 끝나면 두번 째, 세번째 프로세스는 buffer에 저장된 emit된 결과를 가져오기..
https://developer.android.com/training/data-storage/room?hl=ko Room을 사용하여 로컬 데이터베이스에 데이터 저장 | Android 개발자 | Android Developers Room 라이브러리를 사용하여 더 쉽게 데이터를 유지하는 방법 알아보기 developer.android.com
callbackFlow is a flow builder that lets you convert callback-based APIs into flows. As an example, the Firebase Firestore Android APIs use callbacks. To convert these APIs to flows and listen for Firestore database updates, you could use the following code: class FirestoreUserEventsDataSource( private val firestore: FirebaseFirestore ) { // Method to get user events from the Firestore database ..
Async 게으르게 사용하기 async 키워드를 사용하는 순간 코드 블록이 수행을 준비하는데, async(start = CoroutineStart.LAZY)로 인자를 전달하면 우리가 원하는 순간 수행을 준비하게 할 수 있습니다. 이후 start 메서드를 이용해 수행을 준비하게 할 수 있습니다. import kotlin.random.Random import kotlin.system.* import kotlinx.coroutines.* suspend fun getRandom1(): Int { delay(1000L) return Random.nextInt(0, 500) } suspend fun getRandom2(): Int { delay(1000L) return Random.nextInt(0, 500) } ..
https://developer.android.com/codelabs/android-navigation Jetpack Navigation | Android 개발자 | Android Developers 이 Codelab에서는 Android 앱의 일반적인 탐색 요건을 구현하는 방법을 알아봅니다. 탐색 구성요소는 프래그먼트 트랜잭션, 업/백 스택, 탐색 창과 같은 탐색 UI 패턴, 딥 링크 등을 처리합니다. 새 유 developer.android.com 조금 더 공부를 해서 정리해야겠다. Navigation을 쓰니 굉장히 편한 것 같다.
https://junyoung-developer.tistory.com/175 [Android] Moshi를 이용한 Retrofit2 통신 최근 프로젝트를 하면서 서버와 통신하는 작업을 하게 되었습니다. 그래서 기존에 사용하던 Retrofit2와 GSON으로 작업을 진행하려고 했다가, 새롭게 사용할 라이브러리가 있을까하고 찾아보게 되 junyoung-developer.tistory.com https://github.com/square/moshi GitHub - square/moshi: A modern JSON library for Kotlin and Java. A modern JSON library for Kotlin and Java. Contribute to square/moshi development ..
https://developer.android.com/topic/libraries/architecture/paging/v3-overview?hl=ko 페이징 라이브러리 개요 | Android 개발자 | Android Developers 페이징 라이브러리 개요 Android Jetpack의 구성요소 페이징 라이브러리를 사용하면 로컬 저장소에서나 네트워크를 통해 대규모 데이터 세트의 데이터 페이지를 로드하고 표시할 수 있습니다. developer.android.com Paging 라이브러리 핵심 구성요소 PagingSource : 특정 페이지 쿼리의 데이터 청크를 로드하는 기본 클래스. 데이터 레이어의 일부이며 일반적으로 DataSource클래스에서 노출되고 이후에 ViewModel에서 사용하기 위해 Rep..