Shape Shape point chapter-list Group Group Group Group Group Shape Copy 12 Shape Shape Copy 3 Shape Shape dropdown editor editor Combined Shape grid Shape Copy 4 Shape Copy 7 Shape language language Shape megaphone paperback Shape platform noun_419259-2 copy play-icon BS-Question-Rounded-Circle quotes noun_610406 stacked-books-1 stacked-books-2 Group Group Group Group Group Group Group Group Group Path

Saving Data on Android

$59.99 5/5 3 reviews · Write a Review
  • Platform Android 10
  • Language Kotlin 1.3
  • Editor AS 3.5

A book that will teach you to persist data on Android — saving locally or remotely — along with the modern techniques for synchronization, allowing your app to be reactive and always up-to-date.

Developer Guide

Intermediate

For Intermediate Developers

Save Data on Android!

The persistence of data has always been a fundamental part of any application. Saving data locally or remotely with the modern techniques for synchronization allows your app to be always up-to-date, reactively presenting fresh data.

This book is for intermediate Kotlin or Android developers who want to know how to persist data using the standard Android APIs, the Room architecture component or what Google Firebase can offer.

Topics Covered in This Book

  • Persistence with Android SDK: Learn how to manage files, SharedPreferences or SQLite databases using the APIs the Android platform has to offer by default.
  • Using Room: Room is one of the most important Google Architecture Component. It allows managing entities and relations using classic Object-Oriented principles. In this book, you'll learn everything you need to store data and run queries on top of it.
  • Manage relations with Room: A database has entities and relations. With this book, you'll learn how to design your DB and how to manage relations eagerly and lazily.
  • Managing and testing Migrations: Every application evolves in time. Here you'll learn how to manage migrations with Room and how to test them properly.
  • Firebase Realtime Database: If you want to manage data locally and in remote, you can use the tools provided by Google through the Firebase platform. With Firebase Realtime Database you can manage and keep in sync data in a very simple and efficient way.
  • Cloud Storage: Another option provided by Google is the Cloud Storage which allows you to leverage all the power of Google infrastructure to manage your data and run expensive queries.

Table of Contents

Section I: Saving Data Using Android SDK

1.

Using Files - New

Android contains most of the API of Java and so the abstractions into the java.io package which allow you to deal with Files. In this chapter, you'll learn how to create, write, update and delete data into files. Here you'll have the opportunity to manage security using encryption and permissions.

2.

Using SharePreferences - New

SharedPreferences are useful if you need to persist a small quantity of data like texts or a set of values of primitive types. In this chapter, you'll learn how to persist and recover a small quantity of data.

3.

SQLite Database - New

Android also provides SQLite as a small and powerful DataBase Management System. In this chapter, you'll learn how to create a DB with SQLite and how to execute queries. You'll also learn how to manage the lifecycle of a DB from the creation to the upgrade or downgrade of versions.

4.

Content Provider - New

Android also provides an abstraction on top of a DB SQLite or memory, that allows different applications to communicate and share information safely and securely. You can do this using ContentProvide which is one standard component of Android. In this chapter, you'll learn how to create a ContentProvider and how to use it to make applications to communicate.

Section II: Using Room

5.

Room Architecture - New

In this first chapter of the section, you'll learn what Room is and how it works. You'll see what the main components are, how to configure the library and start creating a Database.

6.

Entity Definition - New

You can define a database as a set of entities and relations. In this chapter, you'll learn how to create a DB with Room starting from the entities. You'll create, step by step, a sample application using the annotations provided by the framework.

7.

Mastering Relations - New

As said in the previous chapter, entities and relations are the most important concepts in a relational DB. In this chapter, you'll learn how to define relations and how to read related data efficiently.

8.

The DAO Pattern - New

Data Access Object is the pattern Room has implemented to execute queries on top of a specific set of entities. In this chapter, you'll learn how to define relations between entities and how to optimize queries between them.

9.

Using Room with Google’s Android Architecture Component - New

Room is not the only Architecture Component. Google also announced components like Lifecycle, LiveData, and DataModel. In this chapter, you'll learn how to use Room with the other architecture components.

10.

Data Migration - New

Every Database has a lifecycle and needs to be updated. Applications continuously change and it's important to update the schema of a DB without losing any data or relations. In this chapter, you'll learn how to manage data migrations with Room in a simple and declarative way.

Section III: Using Firebase

11.

Firebase Overview - New

In this first chapter, you'll learn what Firebase is and why Google decided to provide a product like. You'll learn about its history and you'll start creating your first project using the Firebase Console. You'll also have the first introduction to all the products of the Firebase suite.

12.

Introduction to Firebase Realtime Database - New

In this chapter, you'll learn how to configure a project with the Realtime Database features provided by Firebase. This is a very important chapter because it contains configuration details that are very important also for the following chapters. You'll learn how to download and install into your project the JSON configuration file and how to manage authentication.

13.

Reading to and Writing from Realtime Database - New

CRUD means Create Retrieve Update and Delete and it's a way to summarise the main operations you can do on a DB. In this chapter, you'll learn how to execute read and write operations into a Realtime Database from an Android application.

14.

Realtime Database Offline Capabilities - New

Mobile applications run on a device with limited resources. In particular, a phone or a tablet is not always connected to the network and some feature hs to be implemented when you need to write and read data from a remote database. In this chapter, you'll learn how to manage data when the device is offline.

15.

Usage & Performance - New

Everything has a cost. In this chapter, you'll learn about two important aspects of every application and in particular of every mobile application: cost and performance.

16.

Introduction to Cloud Firestore - New

You've already seen how to use a Firebase Realtime Database. In this chapter, you'll learn how to use another similar product which allows you to store and synchronize data from a mobile device into a NoSQL database: Cloud Firestore.

17.

Managing Data with Cloud Firestore - New

In this chapter, you'll learn how to set up an application into Cloud Firestore. Implementing the WhatsUp application, you'll learn how to create a DB using the Firebase console and how to set up the main configurations.

18.

Reading Data from Cloud Firestore - New

In this chapter, you'll continue working on the WhatsUp application and you'll focus on implementing reading logic. In the process, you'll learn how to read data from the Firestore, how to listen for updates in real-time, and how queries work.

19.

Securing Data in Cloud Firestore - New

In this chapter, you'll learn what are security rules in Cloud Firestore and how to add them to your database to make your data safe.

20.

Cloud Storage - New

In this last chapter, you'll learn how to store media files using another Firebase feature called Cloud Storage. You'll learn how to store an image to the cloud and how to get a URL to the image to display it in your app.

Meet the Team

Average Rating

5 /5

Leave a review for this product

3 reviews

Saving Data on Android

A book that will teach you to persist data on Android — saving locally or remotely — along with the modern techniques for synchronization, allowing your app to be reactive and always up-to-date.

Top