Session
SharedPreferences Caterpillar to DataStore Butterfly: How to Migrate and Make Your App Fly
In this talk, you will be taken on an overview of how to migrate from using SharedPreferences to using DataStore in a complex, mature app setting. It is inspired by and based on a real-life implementation in a large enterprise project and delves into the "behind the scenes" of dos and don'ts, providing valuable insights to ease your transition. The talk starts with a short introduction and comparison between SharedPreferences and DataStore and dives into the proposed approaches for implementing the latest data management mechanism.
Key takeaways:
How to structure SharedPreferences so it can be easier to migrate to DataStore
How to utilize dependency injection in the solution
How to use ReadWriteProperty in relation to DataStore
When to use Preference DataStore and when to use Proto DataStore
What to do with complex objects stored as strings
Possible hurdles with the async nature of DataStore and how to approach them
Future DataStore-to-DataStore migrations
Notes about testing
Keywords: SharedPreferences, DataStore, Android
Viktor Arsovski
N47, Senior Software Engineer
Skopje, North Macedonia
Links
Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.
Jump to top