Create your account

Already have an account? Login here

Create account

59. Advanced Realm Concepts

Design + Code an Android App from Scratch

Woah, wait a second..

Scrounge up some loose change to buy this course, or login to your account to view this lesson.

Alright, buy it for $25 Or login to your account if you purchased already.

This video talks about the advanced parts of realm android. The realm database file is located by default in the data/data/files/ directory and you get an instance of the default database by saying getInstance. You can create your own Realm database file for which you need to supply a RealmConfiguration object. It controls several aspects such as whether you want to perform encryption, your database version and so on. We set the default configuration after creating it by calling Realm.setDefaultConfiguration. RealmList or RealmResults or RealmObjects cannot be passed across different threads. To get the same results across threads, query the same results again. When you are done using Realm, don’t forget to close Realm instances. To directly load JSON object into the database, use createObjectFromJson method and to load a JSON array into the database directly, use the createAllFromJson method. When realm model is edited, don’t forget to change the schema number of the database or write a custom migration which basically enables realm to maintain data in the new table’s format. Realm provides a RealmBaseAdapter that lets you integrate the database directly with ListView or GridView

Course Cirriculum