Skip to main content

Posts

Featured

DataStore / SharedPreferences 2026 - Part 1 of 2

Introduction Below, we will look at the standard way to store preference data (or other small amounts). In  Part 2 (not yet live) , we will move on to how to improve it. Part 1 of this guide is a good refresher for Android Compose users, especially those that haven't needed to use DataStore recently/yet and perhaps have been using SharedPreferences. Full code listings are provided below so everything should work without needing any special information. For newer programmers, this should serve as a good introduction and an easy way to get this up and running fast. I actually found it quite hard to find a full minimal working example of a Repository , ViewModel , and UI online so I am hoping this fills a niche. Part 2 is aimed at intermediate to advanced users and should provide some useful ideas on how to improve things. Recommended System Rather than try to explain everything about DataStore and SharedPreferences (like a thousand other blogs and tutorials), I'll start...

Latest Posts

KMP AGP 9.0.0 - Android Application to Library Migration