Search in sources :

Example 36 with RealmConfiguration

use of io.realm.RealmConfiguration in project MPAndroidChart by PhilJay.

the class RealmBaseActivity method onResume.

@Override
protected void onResume() {
    super.onResume();
    // Create a RealmConfiguration that saves the Realm file in the app's "files" directory.
    RealmConfiguration realmConfig = new RealmConfiguration.Builder().build();
    Realm.setDefaultConfiguration(realmConfig);
    mRealm = Realm.getDefaultInstance();
}
Also used : RealmConfiguration(io.realm.RealmConfiguration)

Example 37 with RealmConfiguration

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);
}
Also used : RealmConfiguration(io.realm.RealmConfiguration)

Example 38 with RealmConfiguration

use of io.realm.RealmConfiguration in project app by TourLive.

the class ImportFragment method resetDataToImport.

private void resetDataToImport() throws IOException {
    RealmConfiguration config = new RealmConfiguration.Builder().name(REALREAM).deleteRealmIfMigrationNeeded().modules(new RealmModul()).build();
    RadioTourApplication.setInstance(config);
}
Also used : RealmModul(ch.hsr.sa.radiotour.dataaccess.RealmModul) RealmConfiguration(io.realm.RealmConfiguration)

Example 39 with RealmConfiguration

use of io.realm.RealmConfiguration in project app by TourLive.

the class RadioTourApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    Realm.init(this);
    RealmConfiguration config = new RealmConfiguration.Builder().name("radiotour.realm").deleteRealmIfMigrationNeeded().modules(new RealmModul()).build();
    Realm.setDefaultConfiguration(config);
    realmConfig = config;
    Stetho.initialize(Stetho.newInitializerBuilder(this).enableDumpapp(Stetho.defaultDumperPluginsProvider(this)).enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build()).build());
}
Also used : RealmConfiguration(io.realm.RealmConfiguration)

Example 40 with RealmConfiguration

use of io.realm.RealmConfiguration in project Neuronizer by djuelg.

the class RepositoryManager method exportRepository.

public static boolean exportRepository(File destination, String activeRealm) {
    if (!destination.exists()) {
        RealmConfiguration configuration = createConfiguration(activeRealm);
        Realm realm = Realm.getInstance(configuration);
        realm.writeEncryptedCopyTo(destination, letMeReadImLegit());
        realm.close();
        return true;
    }
    return false;
}
Also used : RealmConfiguration(io.realm.RealmConfiguration) Realm(io.realm.Realm)

Aggregations

RealmConfiguration (io.realm.RealmConfiguration)64 Realm (io.realm.Realm)20 DynamicRealm (io.realm.DynamicRealm)17 Scheduler (io.reactivex.Scheduler)14 RealmChangeListener (io.realm.RealmChangeListener)8 BeforeExperiment (dk.ilios.spanner.BeforeExperiment)6 Before (org.junit.Before)5 DynamicRealmObject (io.realm.DynamicRealmObject)4 RealmList (io.realm.RealmList)4 RealmResults (io.realm.RealmResults)4 ArrayList (java.util.ArrayList)4 Test (org.junit.Test)4 Context (android.content.Context)3 OrderedCollectionChangeSet (io.realm.OrderedCollectionChangeSet)3 OrderedRealmCollectionChangeListener (io.realm.OrderedRealmCollectionChangeListener)3 RealmObjectSchema (io.realm.RealmObjectSchema)3 AllTypes (io.realm.entities.AllTypes)3 IntentFilter (android.content.IntentFilter)2 LinearLayout (android.widget.LinearLayout)2 RealmSchema (io.realm.RealmSchema)2