How to prepopulate realm file in Kotlin SDK?

Viewed 82

In Java SDK, I was creating Realm.Configuration object with the realm file that located in asset folder. I couldn't find any equivalent property in Realm Kotlin SDK

in java SDK:

val populatedRealmConfiguration = RealmConfiguration.Builder()
    .schemaVersion(REALM_VERSION)
    .compactOnLaunch()
    .encryptionKey(resolveEncrypt(RealmHelperStatics.EncRealmKey).toByteArray())
    .assetFile("populated.realm")
    .name("populated.realm")
    .allowQueriesOnUiThread(true)
    .allowWritesOnUiThread(true)
    .build()

I have followed the migration guide: https://www.mongodb.com/docs/realm/sdk/kotlin/migrate-from-java-sdk-to-kotlin-sdk/

How to use ".assetFile" property in Kotlin SDK ?

2 Answers
Related