當前位置: 首頁>>代碼示例>>Java>>正文


Java ActiveAndroid.initialize方法代碼示例

本文整理匯總了Java中com.activeandroid.ActiveAndroid.initialize方法的典型用法代碼示例。如果您正苦於以下問題:Java ActiveAndroid.initialize方法的具體用法?Java ActiveAndroid.initialize怎麽用?Java ActiveAndroid.initialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.activeandroid.ActiveAndroid的用法示例。


在下文中一共展示了ActiveAndroid.initialize方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import com.activeandroid.ActiveAndroid; //導入方法依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();
    Log.setCallback(this);
    Prefs.setServer(getServer());
    ActiveAndroid.initialize(this);
    Fabric fabric = new Fabric.Builder(this)
            .kits(new Crashlytics())
            .debuggable(true)
            .build();
    Fabric.with(fabric);
    if (Prefs.hasName()) {
        Crashlytics.setUserName(Prefs.getName());
    }
    if (Prefs.hasUsername()) {
        Crashlytics.setUserEmail(Prefs.getUsername());
    }
    Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler());
}
 
開發者ID:symph-team,項目名稱:mobile-android-survey-app,代碼行數:20,代碼來源:Application.java

示例2: onCreate

import com.activeandroid.ActiveAndroid; //導入方法依賴的package包/類
@Override
public boolean onCreate() {
	ActiveAndroid.initialize(getConfiguration());
	sAuthority = getAuthority();

	final List<TableInfo> tableInfos = new ArrayList<TableInfo>(Cache.getTableInfos());
	final int size = tableInfos.size();
	for (int i = 0; i < size; i++) {
		final TableInfo tableInfo = tableInfos.get(i);
		final int tableKey = (i * 2) + 1;
		final int itemKey = (i * 2) + 2;

		// content://<authority>/<table>
		URI_MATCHER.addURI(sAuthority, tableInfo.getTableName().toLowerCase(), tableKey);
		TYPE_CODES.put(tableKey, tableInfo.getType());

		// content://<authority>/<table>/<id>
		URI_MATCHER.addURI(sAuthority, tableInfo.getTableName().toLowerCase() + "/#", itemKey);
		TYPE_CODES.put(itemKey, tableInfo.getType());
	}

	return true;
}
 
開發者ID:symph-team,項目名稱:mobile-android-survey-app,代碼行數:24,代碼來源:ContentProvider.java

示例3: onCreate

import com.activeandroid.ActiveAndroid; //導入方法依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();

    //initialize a database and the Crashlitics
    ActiveAndroid.initialize(this);
    Fabric.with(this, new Crashlytics());

    //The first time you need create file with key: "redmine_key.json"
    // file must have next values:
    // { "key": "5d263a7acadb85301873a17a58" }
    String key = Utility.getInstance().loadKey(getApplicationContext());

    //save the key to the database
    AppSettings.setKey(key);

    //init Calls
    Calls.getInstance();
    Calls.setContext(getApplicationContext());

    // Start alarm
    AlarmReceiver.schedule(getApplicationContext());
}
 
開發者ID:andrewgrow,項目名稱:Redmine-Notifications,代碼行數:24,代碼來源:StartApp.java

示例4: InitDb

import com.activeandroid.ActiveAndroid; //導入方法依賴的package包/類
public static void InitDb(Context context) {//KS
    Configuration dbConfiguration = new Configuration.Builder(context).create();
    try {
        SQLiteDatabase db = Cache.openDatabase();
        if (db != null) {
            Log.d("wearSENSOR", "InitDb DB exists");
        }
        else {
            ActiveAndroid.initialize(dbConfiguration);
            Log.d("wearSENSOR", "InitDb DB does NOT exist. Call ActiveAndroid.initialize()");
        }
    } catch (Exception e) {
        ActiveAndroid.initialize(dbConfiguration);
        Log.d("wearSENSOR", "InitDb CATCH: DB does NOT exist. Call ActiveAndroid.initialize()");
    }
}
 
開發者ID:NightscoutFoundation,項目名稱:xDrip,代碼行數:17,代碼來源:Sensor.java

示例5: onCreate

import com.activeandroid.ActiveAndroid; //導入方法依賴的package包/類
public void onCreate() {
    super.onCreate();

    Iconify.with(new FontAwesomeModule());
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
            .setDefaultFontPath("fonts/bariol_regular-webfont.ttf")
            .setFontAttrId(R.attr.fontPath)
            .build());

    Configuration dbConfiguration = new Configuration.Builder(this)
            .setDatabaseName("storage.db")
            .addModelClass(NewsModel.class)
            .create();

    ActiveAndroid.initialize(dbConfiguration);
}
 
開發者ID:niranjan94,項目名稱:amrita-info-desk,代碼行數:17,代碼來源:MainApplication.java

示例6: onCreate

import com.activeandroid.ActiveAndroid; //導入方法依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();

    ActiveAndroid.initialize(new Configuration.Builder(this)
                                     .setDatabaseName("activeandroid")
                                     .setDatabaseVersion(1)
                                     .setModelClasses(SimpleAddressItem.class, AddressItem.class,
                                                      AddressBook.class, Contact.class).create());

    Ollie.with(this)
            .setName("ollie")
            .setVersion(1)
            .setLogLevel(Ollie.LogLevel.FULL)
            .init();

    FlowManager.init(this);

    Sprinkles.init(this, "sprinkles.db", 2);

    RealmConfiguration realmConfig = new RealmConfiguration.Builder(this).build();
    Realm.setDefaultConfiguration(realmConfig);

    mDatabase = getDatabase();
}
 
開發者ID:Raizlabs,項目名稱:AndroidDatabaseLibraryComparison,代碼行數:26,代碼來源:MainApplication.java

示例7: onCreate

import com.activeandroid.ActiveAndroid; //導入方法依賴的package包/類
@Override
public void onCreate()
{
	super.onCreate();
	Log.e(TAG, "I command you to log my cat.");
	instance = this;
	Configuration configuration = new Configuration.Builder(this)
		.setDatabaseName(this.getPackageName())
		.setDatabaseVersion(1)
		.create();
	ActiveAndroid.initialize(configuration);
	ExcludeFieldsWithoutSerializedName efwosn = new ExcludeFieldsWithoutSerializedName();
	Ion.getDefault(this)
		.configure()
		.setGson(new GsonBuilder()
			.addSerializationExclusionStrategy(efwosn)
			.addDeserializationExclusionStrategy(efwosn)
			.serializeNulls()
			.create());
}
 
開發者ID:Shujito,項目名稱:AddressBook_eclipse,代碼行數:21,代碼來源:AddressBookApplication.java

示例8: onCreate

import com.activeandroid.ActiveAndroid; //導入方法依賴的package包/類
@SuppressLint("NewApi")
@Override
public void onCreate() {

	super.onCreate();
	ActiveAndroid.initialize(this);

	// // enable strict mode if android os version is above 8
	// if (android.os.Build.VERSION.SDK_INT > 8) {
	// // set strict mode
	// StrictMode.setThreadPolicy(new
	// StrictMode.ThreadPolicy.Builder().detectAll()
	// .penaltyLog().penaltyDialog().build());
	// StrictMode.setVmPolicy(new
	// StrictMode.VmPolicy.Builder().detectAll().penaltyLog()
	// .build());
	//
	// }

}
 
開發者ID:dbalaouras,項目名稱:greece-phonebook-android,代碼行數:21,代碼來源:AndroidApplication.java

示例9: setUp

import com.activeandroid.ActiveAndroid; //導入方法依賴的package包/類
@Override
protected void setUp() {
    Configuration conf = new Configuration.Builder(getContext())
            .setDatabaseName("CacheTest")
            .addModelClasses(CacheTestModel.class, CacheTestModel2.class)
            .create();
    ActiveAndroid.initialize(conf, true);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:CacheTest.java

示例10: onCreate

import com.activeandroid.ActiveAndroid; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ActiveAndroid.initialize(this);
    setContentView(R.layout.activity_home);
    activity = this;
    initComponents();
    initList();
}
 
開發者ID:EseCoder,項目名稱:cryptotracker,代碼行數:10,代碼來源:HomeActivity.java

示例11: onCreate

import com.activeandroid.ActiveAndroid; //導入方法依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();
    setApplication(this);
    ActiveAndroid.initialize(this);
    applicationComponent = DaggerApplicationComponent.builder().applicationModule(new ApplicationModule(this)).networkModule(new NetworkModule(this))
            .build();
}
 
開發者ID:Rahulpurohit,項目名稱:AndroidMVP-Dagger2-JavaRx-ActiveAndroidORM,代碼行數:9,代碼來源:MyApplication.java

示例12: onCreate

import com.activeandroid.ActiveAndroid; //導入方法依賴的package包/類
@Override
public void onCreate() {
    xdrip.context = getApplicationContext();
    super.onCreate();
    PreferenceManager.setDefaultValues(this, R.xml.preferences, true);
    ActiveAndroid.initialize(this);
    BgReading.updateDB(); // migrate database format
    JoH.forceBatteryWhitelisting();
 }
 
開發者ID:NightscoutFoundation,項目名稱:xDrip,代碼行數:10,代碼來源:xdrip.java

示例13: fullDatabaseReset

import com.activeandroid.ActiveAndroid; //導入方法依賴的package包/類
public static void fullDatabaseReset() {
    try {
        clearCache();
        ActiveAndroid.dispose();
        ActiveAndroid.initialize(xdrip.getAppContext());
    } catch (Exception e) {
        Log.e(TAG,"Error restarting active android db");
    }
}
 
開發者ID:NightscoutFoundation,項目名稱:xDrip,代碼行數:10,代碼來源:JoH.java

示例14: onCreate

import com.activeandroid.ActiveAndroid; //導入方法依賴的package包/類
@Override
   public void onCreate() {
       super.onCreate();
       ActiveAndroid.initialize(this);
       BleLog.setPrintLog(true);
       AppLog.setPrintLog(true);

	_instance = this;
}
 
開發者ID:captain-miao,項目名稱:bleYan,代碼行數:10,代碼來源:AppHolder.java

示例15: onCreate

import com.activeandroid.ActiveAndroid; //導入方法依賴的package包/類
@Override
public void onCreate() {
	super.onCreate();
	
	mAppContext = this.getApplicationContext();
	ActiveAndroid.initialize(this);
	
	Logger.setTag("benshen");
	Logger.d("Application onCreate");
	
	Logger.d("[App] thread id: " + Thread.currentThread().getId());
}
 
開發者ID:benshen,項目名稱:HackNews,代碼行數:13,代碼來源:App.java


注:本文中的com.activeandroid.ActiveAndroid.initialize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。