Pretty much as the title says.
I want to launch my Android app, using ObjectBox, but I\'d like the data to be prepopulated in the boxes.
Can I package both
As to the original question: yes, you can ship your app with an initial data file. You can prepare an ObjectBox database with all the data you need and then grab the data.mdb from the db director (default name is "objectbox").
The BoxStoreBuilder
offers the overloaded method initialDbFile
this:
initialDbFile(java.io.File initialDbFile)
initialDbFile(Factory<java.io.InputStream> initialDbFileFactory)
Thus, you can either provide a File
or an InputStream
.