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

60. Add Drop To Realm Database

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 shows how to insert data into android realm database. Create a model class that extends from RealmObject, define a list of instance variables that will act as columns in the table the class will act as the table itself, add a few getter and setter methods that are needed to read and update values to the Realm database. Add the dependency for Realm in build.grade file and hit sync now. Simply create a plain object of the model class, set the required values using the model setter or constructors, get an instance of realm, begin a transaction, write the values and commit the transaction. To see if the data was successfully saved, use the Realm Browser to view the database file with the help of the Android Monitor.

Course Cirriculum