Saving Data on Android
A book that will teach you to persist data on Android by saving it locally or remotely. Also includes modern synchronization techniques, allowing your app to be reactive and always up-to-date. By Harun Wangereka, Subhrajyoti Sen & Fuad Kamal.
Who is this for?
This book is for intermediate Kotlin or Android developers who want to know how to persist data using the standard Android APIs, Jetpack DataStore, the Room Architecture Component or Google Firebase.
- Persistence with Android SDK
- Saving data with Jetpack DataStore
- Using Room
- Manage relations with Room
- Managing and testing Migrations
- Firebase Realtime Database
- Cloud Storage
Persisting data has always been a fundamental part of any app. Saving data locally or remotely with modern techniques for synchronization allows your app to always be up-to-date, reactively presenting fresh data.
This book is for intermediate Kotlin or Android developers who want to know how...more
Before You Begin
This section tells you a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book, and more.
Saving Data Using Android SDK & Jetpack DataStore
Ready to learn all about how to persist data in your app? In this chapter, you’ll use practical examples to see how to use the API that Android SDK provides to persist data. You’ll learn when and how to manage persistence depending on the type and quantity of data.
Your main focus will be on storing data to Files, SharedPreferences and SQLite Database. You’ll also learn how to share data across multiple apps with ContentProvider.
Finally, you’ll learn how to use Jetpack DataStore, Google’s latest tool for handling data persistence. Along the way, you’ll see how to migrate from SharedPreferences to Jetpack DataStore.
Architecture Components made their debut at Google I/O 2018. Google presented them as a set of solutions for the most common problems in the development of Android apps. Data persistence was among those problems, and one solution that Architecture Components offers is Room. In this section, you’ll learn how to use the Room library to persist data in your apps and how to safely migrate data after you change your database schema.
Firebase is a mature suite of products that allow you to implement Android apps that persist information safely, securely and reliably. In this section, you’ll learn the fundamentals and more advanced concepts of Firebase, including how to read and write to Realtime Database, how to use it in offline mode and everything you need to know about its usage and performance. You’ll learn a few things about managing and securing data in Cloud Firestore. Finally, the last part of the section contains basics about Cloud Storage.