3

Android DataStore | raywenderlich.com

 3 years ago
source link: https://www.raywenderlich.com/20555043-android-datastore
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Android DataStoreGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupShapeGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroupGroup

This course is available as part of the raywenderlich.com Professional subscription. To learn more click here

Android DataStore

Apr 20 2021 · Video Course (44 mins) · Intermediate

DataStore is Google’s new and improved solution for persisting simple pieces of data by using either key-value pairs or protocol buffers for storing typed objects. It does so using Kotlin Coroutines and Flow to make all the transactions asynchronous, making all the data storing and fetching operations more performant and safe! It’s part of the Jetpack set of tools, so it’s also known as the Jetpack DataStore. In this course, learn how to store simple and complex typed data in Jetpack DataStore as well as migrating existing data from Shared Preferences.

Version

  • Kotlin 1.4, Android 6, Android Studio 4

Android DataStore

Learn how to implement a theme change functionality by storing the current theme in SharedPreferences. Also prepare to develop other parts of the app by enabling auto import in your settings.

Jetpack DataStore is a solution for data persistence that lets you store key-value pairs or typed objects by using protocol buffers. In this episode learn all you need to know about DataStore and the advantages it provides over SharedPreferences.

In the previous episode we stored our theme’s information in SharedPreferences. While this is fine in most cases it is not using DataStore and our course is all about DataStore, right? In this episode start migrating our information to Jetpack DataStore.

Now that you have created your Prefs Datastore it is time to use it. In this episode learn how to read and observe data from Prefs DataStore using your ViewModels.

In this episode, learn how to observe data from Prefs DataStore using your ViewModels.

Reading and observing data from Prefs DataStore is fine but we still need to be able to save information. In this episode learn how to write data to DataStore.

Proto DataStore uses protocol buffers to serialize data. Protocol buffers are Google’s language-neutral and platform-neutral mechanisms for serializing structured data. In this episode start implementing filtering with Proto DataStore.

In order to let DataStore know how to read and write the data type you previously defined, you will need a Serializer. In this episode, create a Serializer for your filter_options.proto file.

Now that your Proto DataStore is ready you need to start using it. In this episode learn how to read the filter options saved in DataStore.

In the last episode of this course add the code to react to filter changes and update the UI accordingly.

Who is this for?

Intermediate level Android developers who want to learn about the new Android Jetpack DataStore API. This course will be particularly useful if you want to learn more about how to save data in Android.

Covered concepts

  • Storing Simple Key-value Pairs
  • Storing Complex Data
  • Migrating Existing Data
  • Protocol Buffers

Contributors

Aldo Olivares

Mobile Developer passionate about creating amazing apps with great user interfaces. Founder of aldominium.com, company...

Instructor
Adriana Kutenko

Graphic Illustrator with a Bachelor’s Degree in Fine Arts. I am a perpetual perfection seeker with a big passion for History...

Illustrator

Comments

Add a rating for this content

Sign in to add a rating

All videos. All books.
One low price.

A raywenderlich.com subscription is the best way to learn and master mobile development — plans start at just $19.99/month!

Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.

The largest and most up-to-date collection of courses and books on iOS, Swift, Android, Kotlin, Flutter, Dart, Server-Side Swift, Unity and more!

All videos. All books. One low price.

A raywenderlich.com subscription is the best way to learn and master mobile development — plans start at just $19.99/month!

Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalogue of 50+ books and 4,000+ videos.

  • © 2021 Razeware LLC
  • Made with ♥ from around the world
  • 6000+ Tutorials and counting

raywenderlich.com and our partners use cookies to understand how you use our site and to serve you personalized content and ads. By continuing to use this site, you accept these cookies, our privacy policy and terms of service .


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK