Bryan L
06/09/2021, 11:48 PMDay 70, 71, 72
• Implement DataStore in Daily Doc/withRemoteDatabase branch ✅
• Work on fixing schema for room database for physical device
Self-Comment
• Held off on daily updates as I've been focused on getting DataStore to work. Decided not to give up on it, although with the amount of time I took, I probably should have used SharedPref as an alternative.
◦ What a great feeling to have it finally implemented! I need to clean up the extra code now that it's complete (not encrypted yet)
◦ Went back and forth between trying to use Preferences DataStore & Proto DataStore. The main difference between the two is that Preferences isn't Type-Safe while Proto is (uses Protocol Buffers)
◦ I ended up moving my enum class to save in datastore instead of in the navigation file. I believe this stemmed more from the info being drawn from in DrawerState which had to have some extra calls as the state kept getting destroyed / overwritten
◦ Took about a week longer than I anticipated to implement, but it's been a learning experience nonetheless 😆
◦ Some screenshots of spaghetti code before cleanup in thread. Had to come up with a lot of it myself as the examples I came across were hardly relevant to what I was implementing
• Cleaned up some code and decided to test the app on my physical device. Cleared cache/data, however there was an issue with the schema since the database changed (id from long to string, date from string to long). Not sure why it's occuring even after clearing all data from device. Attempting to implement automigration, although I don't believe this will solve the problem. Emulator ran fine, just issues with physical device