What I'm doing right now works to check if this is installed the first time my application is installed and creates a new object.
if (Preferences.freshInstall(getApplicationContext())) { Realm realm = Realm.getDefaultInstance(); realm.beginTransaction(); Category inbox = new Category("Inbox", "#445566"); realm.copyToRealm(inbox); realm.commitTransaction(); Preferences.notNew(getApplicationContext()); }
There must be a better way to do this with Realm Migrations
source share