use of io.realm.RealmConfiguration in project FastAdapter by mikepenz.
the class CustomApplication method onCreate.
@Override
public void onCreate() {
super.onCreate();
// The Realm file will be located in Context.getFilesDir() with name "default.realm"
RealmConfiguration config = new RealmConfiguration.Builder(this).build();
Realm.setDefaultConfiguration(config);
}
use of io.realm.RealmConfiguration in project simple-stack by Zhuinden.
the class DatabaseManager method init.
public void init(Context context) {
Realm.init(context);
RealmConfiguration realmConfiguration = new RealmConfiguration.Builder().deleteRealmIfMigrationNeeded().build();
Realm.setDefaultConfiguration(realmConfiguration);
}
use of io.realm.RealmConfiguration in project realm-java by realm.
the class RealmBenchmarks method before.
@BeforeExperiment
public void before() {
Realm.init(InstrumentationRegistry.getTargetContext());
coldConfig = new RealmConfiguration.Builder().name("cold").build();
RealmConfiguration config = new RealmConfiguration.Builder().build();
Realm.deleteRealm(coldConfig);
Realm.deleteRealm(config);
realm = Realm.getInstance(config);
realm.executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
readObject = realm.createObject(AllTypes.class);
readObject.setColumnString("Foo");
readObject.setColumnLong(42);
readObject.setColumnDouble(1.234D);
}
});
}
use of io.realm.RealmConfiguration in project realm-java by realm.
the class RealmObjectWriteBenchmarks method before.
@BeforeExperiment
public void before() {
RealmConfiguration config = new RealmConfiguration.Builder().build();
Realm.deleteRealm(config);
realm = Realm.getInstance(config);
realm.beginTransaction();
writeObject = realm.createObject(AllTypes.class);
}
use of io.realm.RealmConfiguration in project realm-java by realm.
the class RealmQueryBenchmarks method before.
@BeforeExperiment
public void before() {
RealmConfiguration config = new RealmConfiguration.Builder().build();
Realm.deleteRealm(config);
realm = Realm.getInstance(config);
realm.beginTransaction();
for (int i = 0; i < DATA_SIZE; i++) {
AllTypes obj = realm.createObject(AllTypes.class);
obj.setColumnLong(i);
obj.setColumnBoolean(i % 2 == 0);
obj.setColumnString("Foo " + i);
obj.setColumnDouble(i + 1.234D);
}
realm.commitTransaction();
}
Aggregations