일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Safe Args
- themes.xml
- Binding Adapter
- Gradle
- Jetpack Compose
- Navigation Component
- room
- BottomNavigationView
- recyclerview
- Datastore
- TypeConverter
- 취업
- Livedata
- 일렉트론
- fragment
- ViewModel
- Android
- 테마
- 안드로이드
- 면접
- 스플래시
- imageview
- electron
- kotlin
- android studio
- hilt
- asLiveData()
- 주석
- nav_graph
- 개발자
- Today
- Total
목록Datastore (3)
나만 보는 일기장

DataStore는 SharedPreference를 대체하기 위해 구현된 라이브러리로, PreferenceDataStore와 ProtoDataStore 두 가지 종류가 있습니다. 이 글에서는 Key-Value 형태로 데이터를 저장하는 PreferenceDataStore를 사용해보도록 하겠습니다. 1. 의존성 추가 // PreferenceDataStore def datastore_version = "1.0.0" implementation "androidx.datastore:datastore-preferences:$datastore_version" App Gradle에 추가해줍니다. 2. DataStoreRepository 생성 저는 DataStore를 Repository에 넣어 관리하겠습니다. privat..

java.lang.IllegalStateException: There are multiple DataStores active for the same file: [...] You should either maintain your DataStore as a singleton or confirm that there is no two DataStore's active on the same file (by confirming that the scope is cancelled). 로그인 기능을 구현할 때 메인 액티비티에서 DataStore에 접근해 저장된 토큰값이 있는지 확인하고 없으면 로그인 화면으로 넘기는 방식을 구현하려 했는데, 로그인을 처리하는 액티비티에서도 DataStore를 사용해서 그런지 로그인 화면으..