Create your account

Already have an account? Login here

Note: By joining, you will receive periodic emails from Coursetro. You can unsubscribe from these emails.

Create account

59. Advanced Realm Concepts

Design + Code an Android App from Scratch

Woah, wait a second..

Scrounge up some loose change to become a pro member, or login to your account to view this lesson.

Alright, join now. Or login to your account if you're already a pro member.

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