How can I integrate a real database into my apk?

0
@Override
public void onCreate()
{
    super.onCreate();

    setUpRealmConfig();

    Realm realm = Realm.getDefaultInstance();
    BoardId = getIdByTable(realm, Board.class);
    NoteID = getIdByTable(realm, Note.class);
    realm.close();
}

private void setUpRealmConfig()
{
    RealmConfiguration configuration = new RealmConfiguration
            .Builder(getApplicationContext())
            .name("ucf_database.realm")
            .deleteRealmIfMigrationNeeded()
            .build();
    Realm.setDefaultConfiguration(configuration);
}

Is there any way in the builder to give the path to the database and copy it when it is installed? Any help is appreciated.

    
asked by Alex Rivas 30.04.2018 в 14:26
source

0 answers