I\'ve seen a few SO posts detailing how you bundle prebuilt Realm files with iOS (Obj-c/swift) and Android (Java), but I can\'t find any information on bundling with Xamarin
For anyone wanting to bundle a realm file on native Xamarin.Android you can use the following code. The bundled realm file can be the same name as the final realm file. Just copy the realm file to the Assets directory and make sure the build action is set as AndroidAsset.
var realmDB = "somerealm.realm";
var documentsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
var filePath = Path.Combine(documentsPath, realmDB);
if (!File.Exists(filePath))
{
using (var asset = Assets.Open(realmDB))
using (var destination = File.OpenWrite(filePath))
{
asset.CopyTo(destination);
}
}