Realm Database Configuration on Android – Java Example

Android Realm

This example shows how to configure a Realm Database on Android using default configuration with Java RealmConfiguration class and get the instance of realm thread.

— A Realm is an instance of a Realm Mobile Database container.
— Default Realm configuration uses the Realm file “default.realm” located in Context.getFilesDir().
— To use another configuration, you would create a new RealmConfiguration object.
— The RealmConfiguration can be saved as a default configuration.
— Setting a default configuration in your custom Application class makes it available in rest of your code.


Share This Post On: