Your Second Kotlin Android App

Aug 29 2023 · Kotlin 1.8.21, Android 13, Android Studio Flamingo | 2022.2.1

Part 3: Save Preferences

17. Introduction

Episode complete

Play next episode

Next
About this episode

Leave a rating/review

See forum comments
Cinema mode Mark complete Download course materials
Previous episode: Part 2 Quiz: Create Your View Next episode: 18. Explore Shared Preferences

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Transcript: 17. Introduction

When you last left off with your project, you weren’t displaying any list items and instead, you created an EmptyView to display a message to the user. Now, you’re going to add the ability to save the user’s preferences so that the app can display the list of items that the user wants to see.

In this part, you’ll enable the user to enter their to-do lists. Doing so will require you to do a few things. First, you’ll need to provide a way to receive data from the user. Here, you implement the logic to show an AlertDialog that will allow the user to enter a new list when the floating action button is clicked.

Next, you’ll learn how to save that information and ultimately read it back again. After all, your app won’t receive very good reviews if it loses your users’ data. You’ll create a ViewModel to help with configuration changes and expose data to your views.