Bryan L
06/05/2021, 2:57 PMDay 68
• Read Medium article: Jetpack Proto DataStore with Kotlin generated classes for Proto schema
• Self-Comment
• I swapped from trying to use DataStore Preferences to DataStore Proto (type safe version)
◦ After some trial and error struggling with implementing a secured version of datastore it finally works without errors. Took some time to figure out how to implement the proto class (message UserData) into various files.
◦ ...Spent the day trying to implement DataStore Proto, but could not get it to actually work. I will try to swap to DataStore Preferences, but I may just use SharedPref. SharedPreferences is a heck of a lot easier to use compared to trying to implement Datastore! Perhaps my biggest issue here is that there just isn't any up to date examples for what I'm looking for, and I'm too unfamiliar with Datastore/caching to figure it out myself.. 🤔Bryan L
06/06/2021, 12:09 AMval Context.userDataStore: DataStore<UserData> by dataStore(
fileName = DATA_STORE_FILE_NAME,
serializer = UserSerializer
)
as dataStore was not recognize. After trying various things, I rechecked the dependencies and noticed
implementation "androidx.datastore:datastore-core:1.0.0-beta01"
was implemented, but did not have
implementation "androidx.datastore:datastore:1.0.0-beta01"
which was required. Only needed for this single import. I suppose it has something to do with proto datastore after alpha 07