How do I export and import all realm data? (Or just one realm file)

966 views
Skip to first unread message

Dmitry Guselnikov

unread,
May 15, 2015, 1:27:34 PM5/15/15
to realm...@googlegroups.com
Hello. I have an app that does initialization of Realm database at first launch. This initialization takes a lot of time and I'm wondering can I just add ready-to-use realm data file to assets folder and then just copy this file to some place at first launch?

Can I achieve this?

Thanks in advance

Emanuele Zattin

unread,
May 15, 2015, 2:41:33 PM5/15/15
to Dmitry Guselnikov, realm...@googlegroups.com
You sure can! Take a look at how we do it in our migration example here:

https://github.com/realm/realm-java/blob/master/examples/migrationExample/src/main/java/io/realm/examples/realmmigrationexample/MigrationExampleActivity.java#L87

I would like to know more about your initialization time. Can you provide us with some numbers?

--
Emanuele Zattin



--
You received this message because you are subscribed to the Google Groups "Realm Java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to realm-java+...@googlegroups.com.
To post to this group, send email to realm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/realm-java/55d5cb0e-efd6-471a-a0f4-51440c3b5f57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



{#HS:91162741-1117#}

Dmitry Guselnikov

unread,
May 16, 2015, 8:52:48 AM5/16/15
to realm...@googlegroups.com
Initialization takes about 1 min (Depends on device) But 99% of this time is xml parsing.

пятница, 15 мая 2015 г., 20:27:34 UTC+3 пользователь Dmitry Guselnikov написал:

Dmitry Guselnikov

unread,
May 16, 2015, 9:10:16 AM5/16/15
to realm...@googlegroups.com
Emanuele, thank you very much. You saved my time!


пятница, 15 мая 2015 г., 20:27:34 UTC+3 пользователь Dmitry Guselnikov написал:
Hello. I have an app that does initialization of Realm database at first launch. This initialization takes a lot of time and I'm wondering can I just add ready-to-use realm data file to assets folder and then just copy this file to some place at first launch?
Reply all
Reply to author
Forward
0 new messages