MrBoutte'
MrBoutte'

Reputation: 349

Realm prepopulated database

Does any one know of any good references for making a prepopulated database in realm for android. I know there's a dedicated program made by the guys from realm for Mac users but assuming I'm not an apple guy, should I be looking into how to transfer my sqlite database into realm or are there resources on how to build one from the ground up in realm?

Upvotes: 1

Views: 317

Answers (1)

Ilya Tretyakov
Ilya Tretyakov

Reputation: 7010

You can write a quick android application for creating realm file and populate it with required data. Then you should get this file from device (or emulator) and put it to the application where you are going to use this. You will find it at \data\data\your.application.id\**\*.realm. Use DDMS for downloading it from device(should be rooted) or emulator.

But I think it is better to save all your data to the json-file. Then use this method createAllFromJson() for importing all objects to realm on the first application start.

Upvotes: 1

Related Questions