docs/guides/realm-files/bundle-a-realm.md
Realm supports bundling realm files. When you bundle a realm file, you include a database and all of its data in your application download.
This allows users to start applications for the first time with a set of initial data.
To create and bundle a realm file with your application:
writeCopyTo()
method to copy the realm to a new file.writeCopyTo() automatically compacts your realm to the smallest
possible size before copying.
Now that you have a copy of the realm that contains the initial data, bundle it with your production application.
Tip: If your application does not already contain an asset folder, you can create one by right clicking on your top-level application folder (<app name>) in Android Studio and selecting New > Folder > Assets Folder in the menu.
Now that you have a copy of the realm included with your production
application, you need to add code to use it. Use the assetFile()
method when configuring your realm to open the realm
from the bundled file.