Sign in Go Pro

Realm & Android Architecture Components

Abstracting RealmResults from your Application to Reduce Coupling and Improve Testability


This lesson is for PRO members.

Upgrade today to get access to all the PRO lessons.

Unlock this lesson

Up next



Traditionally, in a Realm Application, it's been necessary to directly expose RealmResults to the various layers of your app because there was no standard way to deliver the live -- auto updating, reactive -- data that RealmResults provided. This has all changed with the advent of LiveData. LiveData as it's name implies is a container for live, reactive data, that is also Android Lifecycle aware. This lesson will teach you how use Realm with/ LiveData to remove the dependency on RealmResults from outside of your DAO layer. ### Summary of Content (what you will learn): * How to expose `LiveData<List<? extends RealmModel>>` from your DAOs. * Why you no longer need RealmResults when exposing LiveData. * The benefits that LiveData provides. ### Additional Materials * [How to use LiveData w/ Realm]( * [Using LiveData Transformations w/ Realm](

Lessons in Realm & Android Architecture Components