What is the difference between getDefaultInstance() and getInstance() in Realm?
the difference between realm.getDefaultInstance() and realm.getInstance(
context)? In general, when would you choose one of them?
The getDefaultInstance() method instantiates the Realm using the default
getInstance (RealmConfiguration configuration) returns instances using your configuration, such as database
migration, some of which are required in real-world applications. Especially if the Realm platform is in sync.
But if you use getDefaultInstance() in many places in your application, to avoid calling the configuration every time, you can use
setDefaultConfiguration(RealmConfiguration) and then
Your configuration will always be used to return to the Realm instance.