本文整理匯總了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());
}
示例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;
}
示例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());
}
示例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()");
}
}
示例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);
}
示例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();
}
示例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());
}
示例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());
//
// }
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
示例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");
}
}
示例14: onCreate
import com.activeandroid.ActiveAndroid; //導入方法依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
ActiveAndroid.initialize(this);
BleLog.setPrintLog(true);
AppLog.setPrintLog(true);
_instance = this;
}
示例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());
}