Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
96 views

I’m using Jetpack DataStore (Preferences) in a Kotlin Multiplatform Mobile (KMM/KMP) project to store some user data, including a JSON-serialized object: class DataStoreVM( private val dataStore: ...
Pawandeep Singh's user avatar
0 votes
1 answer
105 views

I have swapped SharedPreferences for DataStore in a common module in my Android app. I use DataProperty for easy access to the parameters and and interface MyDataStore injected on need. Because of the ...
ViksaaSkool's user avatar
0 votes
0 answers
54 views

I'm developing a foreground service to display an overlay view. The service uses a ComposeView whose content depends on the data of a Preference DataStore. The content of the ComposeView looks like: //...
E__Man's user avatar
  • 21
2 votes
0 answers
80 views

I’m developing a water-tracking app where a setting like volumeUnit (mL/L) needs to be accessible across almost all screens. I’ve implemented a SettingsManager (using DataStore) and a ...
tereshkevich's user avatar
0 votes
1 answer
103 views

in this code: fun getString(key: Preferences.Key<String>, default: String = ""): Flow<String> { return preferences.data.map { value -> value[key] ?: ...
Mohammad Mohammadi's user avatar
1 vote
2 answers
320 views

I am using a class to store and load data from a DataStore in my kotlin multiplatform app. The class is simple: class AuthPersistence( private val context: Context ) { private val Context....
padmalcom's user avatar
  • 1,507
8 votes
2 answers
683 views

I am working on a Kotlin Multiplatform / Compose Multiplatform app with Android and Desktop as targets. I wanted to use DataStore to store some data locally, namely the user's refresh token and some ...
Damon's user avatar
  • 239
0 votes
1 answer
89 views

I am trying to persist some simple state of my android app using preferences with Jetpack DataStore. I want to fill the value of a key with a default value if there was nothing stored yet. However ...
David's user avatar
  • 1,840
1 vote
0 answers
86 views

I'm trying to write an app that allows audio to be launched from an app and widget using Jetpack Compose and Glance Widgets. The app shows all audio from the device, which can be controlled (start and ...
Пенка Пшеничная's user avatar
2 votes
1 answer
164 views

Whenever I relaunch an app, values that are saved in Preferences Datastore are reset. In particular, I'm trying to save whether the user selected light mode or dark mode for their preferred background ...
Bob Rasner's user avatar
0 votes
2 answers
258 views

Having a composable which has a textfield which needs to work with a by remember mutablestateof String called text, that variable must be initialized with a datastore stored value. I have the ...
NullPointerException's user avatar
1 vote
2 answers
307 views

I'm currently using DataStore to store and collect values to create a UI. There are flows for collecting Volume and Media Path. I understand that when I store a value, it should be collectable in the ...
philo's user avatar
  • 13
4 votes
1 answer
391 views

I updated these implementations in app/build.gradle from 1.0.0 to 1.1.1: implementation "androidx.datastore:datastore-preferences:$androidXDatastore" implementation "androidx.datastore:...
kou's user avatar
  • 61
0 votes
2 answers
660 views

I want to store an access token in the DataStore when it is received. As such i created a class(DataStore) that handles the getting,saving and clearing. Since I want the same instance of DataStore to ...
nero-123's user avatar
0 votes
1 answer
60 views

I am attempting to get the number of lives into the quiz. What seems to happen is that the number of lives from the preferences datastore is stored into the variable, yet when it comes to actually ...
mi-ned32's user avatar
1 vote
1 answer
307 views

When using a specific name for the DataStore ("settings" in this case), the Preference value is not null the first time I open the app. But if I change the DataStore name to something ...
Marco Plasmati's user avatar
0 votes
1 answer
418 views

Would it be a good approach to use runBlocking in following implementation? Would it cause UI to be laggy? I use it all in my viewModel. lateinit var centralReturnsPaging: Flow<PagingData<...
Cuyer's user avatar
  • 76
1 vote
1 answer
267 views

I'm working on an android app in which I have to implement a "hot" theme switching functionality based on a user choice. I started with this article implementing a slight different approach, ...
Santo's user avatar
  • 81
0 votes
1 answer
188 views

WE have a solution in which we have a few data points that are stored in a Perferences Datastore. We realised that we had failed to account for the IOException correctly, and made a fix. For peace of ...
Timo Newton's user avatar
0 votes
1 answer
445 views

I want use Jetpack DataStore in my app and according to setup instruction in: https://developer.android.com/topic/libraries/architecture/datastore I have added the following to my build.gradle.kts(:...
Re Za's user avatar
  • 65
0 votes
0 answers
248 views

I have a repository including a list of words which I connected with a unique checkbox. Each time I close the app I want the checkbox value to be saved. So I am using Jetpack DataStore for that. It ...
Mister Propre's user avatar
0 votes
1 answer
237 views

The Jetpack DataStore documentation has rules that you must only create one instance per file or its functionality will be broken. This seems like a very unusual restriction to me and I have never ...
Tenfour04's user avatar
  • 95.1k
1 vote
2 answers
679 views

Getting the following error, Only a single call to runTest can be performed during one test. In-unit tests for data store. The issue is clearly because I have runTest in @After for data store ...
Abhimanyu's user avatar
  • 15.2k
0 votes
0 answers
529 views

I want to save data using DataStore, here is my implementation: android { namespace 'com.Test' compileSdk 33 useLibrary 'org.apache.http.legacy' defaultConfig { applicationId &...
Bakri's user avatar
  • 1
0 votes
1 answer
1k views

I have an ISO date string like this: 2023-06-13T19:34:35.12345Z and I need to convert it to an com.google.protobuf.Timestamp to store it in a Proto DataStore. How can I do that? (I am using Kotlin on ...
me.at.coding's user avatar
  • 18.5k