@Test public void hashCode_withDifferentRxObservableFactory() { RealmConfiguration config1 = new RealmConfiguration.Builder(context) .directory(configFactory.getRoot()) .rxFactory(new RealmObservableFactory()) .build(); RealmConfiguration config2 = new RealmConfiguration.Builder(context) .directory(configFactory.getRoot()) .rxFactory(new RealmObservableFactory() { @Override public int hashCode() { return super.hashCode() + 1; } }) .build(); assertNotEquals(config1.hashCode(), config2.hashCode()); }
@Override public void onCreate() { super.onCreate(); sContext = this; Hawk.init(this) .setEncryptionMethod(HawkBuilder.EncryptionMethod.MEDIUM) .setStorage(HawkBuilder.newSharedPrefStorage(this)) .setLogLevel(BuildConfig.DEBUG ? LogLevel.FULL : LogLevel.NONE) .build(); RealmConfiguration configuration = new RealmConfiguration.Builder(this) .rxFactory(new RealmObservableFactory()) .build(); Realm.setDefaultConfiguration(configuration); ApiFactory.recreate(); RepositoryProvider.init(); }
@Override public void onCreate() { super.onCreate(); Hawk.init(this) .setEncryptionMethod(HawkBuilder.EncryptionMethod.MEDIUM) .setStorage(HawkBuilder.newSharedPrefStorage(this)) .setLogLevel(BuildConfig.DEBUG ? LogLevel.FULL : LogLevel.NONE) .build(); RealmConfiguration configuration = new RealmConfiguration.Builder(this) .rxFactory(new RealmObservableFactory()) .build(); Realm.setDefaultConfiguration(configuration); sAppComponent = DaggerAppComponent.builder() .dataModule(new DataModule()) .build(); }
public static void initDefaultRealm(@NonNull String dbSuffix, int version, RealmMigration realmMigration) { Realm.removeDefaultConfiguration(); RealmConfiguration.Builder builder = new RealmConfiguration.Builder() .name("db_realm_" + dbSuffix) .schemaVersion(version) .rxFactory(new RealmObservableFactory()); // .deleteRealmIfMigrationNeeded(); if (realmMigration != null) builder.migration(realmMigration); RealmConfiguration realmConfiguration = builder.build(); Realm.setDefaultConfiguration(realmConfiguration); }
public static RealmConfiguration getTalkRealm() { if (realmConfiguration == null) { realmConfiguration = new RealmConfiguration.Builder(MainApp.CONTEXT) .name(TALK_REALM) .schemaVersion(SCHEMA_VERSION) .migration(new Migration()) .rxFactory(new RealmObservableFactory()) .build(); } return realmConfiguration; }
@Override public void onCreate() { super.onCreate(); sInstance = this; Picasso picasso = new Picasso.Builder(this) .downloader(new OkHttp3Downloader(this)) .build(); Picasso.setSingletonInstance(picasso); RealmConfiguration configuration = new RealmConfiguration.Builder(this) .rxFactory(new RealmObservableFactory()) .build(); Realm.setDefaultConfiguration(configuration); }
private void initializeRealm() { Realm.init(this); Realm.setDefaultConfiguration(new RealmConfiguration.Builder() .name("app.realm") .modules(Realm.getDefaultModule(), new LibraryModule()) .rxFactory(new RealmObservableFactory()) .deleteRealmIfMigrationNeeded() .build()); }
private void initializeRealm() { Realm.init(this); Realm.setDefaultConfiguration(new RealmConfiguration.Builder().name("app.realm") .modules(Realm.getDefaultModule(), new LibraryModule()).rxFactory(new RealmObservableFactory()) .deleteRealmIfMigrationNeeded().build()); }