com.raizlabs.android.dbflow.config.FlowConfig Java Examples

The following examples show how to use com.raizlabs.android.dbflow.config.FlowConfig. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JianShiApplication.java    From jianshi with Apache License 2.0 6 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();

  appComponent = DaggerAppComponent.builder()
      .appModule(new AppModule(JianShiApplication.this))
      .build();

  final Fabric fabric = new Fabric.Builder(this)
      .kits(new Crashlytics())
      .debuggable(true)
      .build();
  Fabric.with(fabric);
  Stetho.initializeWithDefaults(this);
  instance = this;
  FlowManager.init(new FlowConfig.Builder(this).openDatabasesOnInit(true).build());

  initLog();

  CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
      .setDefaultFontPath("fonts/jianshi_default.otf")
      .setFontAttrId(R.attr.fontPath)
      .build()
  );
}
 
Example #2
Source File: TyApplication.java    From tysq-android with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 初始化数据库
 */
private void initDb() {
    FlowManager
            .init(FlowConfig.builder(this)
                    .addDatabaseConfig(
                            DatabaseConfig.builder(TyDB.class)
                                    .databaseName(TyDB.NAME)
                                    .build()
                    )
                    .build());

    FlowManager.initModule(TyGeneratedDatabaseHolder.class);
}
 
Example #3
Source File: JerryDownloadConfig.java    From tysq-android with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 初始化
 *
 * @param context
 */
public static void init(Context context) {
    FlowManager
            .init(FlowConfig.builder(context)
                    .addDatabaseConfig(
                            DatabaseConfig.builder(DownloadDB.class)
                                    .databaseName(DownloadDB.NAME)
                                    .build()
                    )
                    .build());

    FlowManager.initModule(JerryMultiDownloadGeneratedDatabaseHolder.class);
}
 
Example #4
Source File: StockHawkApplication.java    From Stock-Hawk with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();

    if (BuildConfig.DEBUG) {
        Timber.plant(new Timber.DebugTree());
        Fabric.with(this, new Crashlytics());
    }

    FlowManager.init(new FlowConfig.Builder(this).build());
    Stetho.initializeWithDefaults(this);
}
 
Example #5
Source File: Model.java    From UPMiss with GNU General Public License v3.0 5 votes vote down vote up
public static void setApplication(Application application) {
    APPLICATION = application;
    // DB Flow init
    FlowManager.init(new FlowConfig.Builder(application)
            .openDatabasesOnInit(true)
            .build());

    Model.log(TAG, "setApplication");
}
 
Example #6
Source File: DBFlowExecutor.java    From android-orm-benchmark-updated with Apache License 2.0 5 votes vote down vote up
@Override
public long createDbStructure() throws SQLException
{
    long start = System.nanoTime();

    FlowManager.init(
        new FlowConfig.Builder(applicationContext)
            .openDatabasesOnInit(true)
        .build()
    );
    return System.nanoTime() - start;
}
 
Example #7
Source File: TavernaApplication.java    From incubator-taverna-mobile with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();

    FlowManager.init(new FlowConfig.Builder(this).build());
    if (BuildConfig.DEBUG) {
        Stetho.initializeWithDefaults(this);
    }

    if (LeakCanary.isInAnalyzerProcess(this)) {
        return;
    }
    LeakCanary.install(this);

}
 
Example #8
Source File: DefaultAddressProvider.java    From JDAddressSelector with MIT License 4 votes vote down vote up
public DefaultAddressProvider(Context context) {
    FlowManager.init(new FlowConfig.Builder(context.getApplicationContext()).build());
}
 
Example #9
Source File: DemoApp.java    From DBFlowManager with Apache License 2.0 4 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();

    FlowManager.init(new FlowConfig.Builder(this).build());
}
 
Example #10
Source File: PerfTestDbFlow.java    From android-database-performance with Apache License 2.0 4 votes vote down vote up
@Override
public void setUp() throws Exception {
    super.setUp();

    FlowManager.init(new FlowConfig.Builder(getTargetContext()).build());
}