本文整理汇总了Java中com.orhanobut.hawk.HawkBuilder类的典型用法代码示例。如果您正苦于以下问题:Java HawkBuilder类的具体用法?Java HawkBuilder怎么用?Java HawkBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HawkBuilder类属于com.orhanobut.hawk包,在下文中一共展示了HawkBuilder类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.orhanobut.hawk.HawkBuilder; //导入依赖的package包/类
@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();
}
开发者ID:ArturVasilov,项目名称:AndroidSchool,代码行数:20,代码来源:AppDelegate.java
示例2: onCreate
import com.orhanobut.hawk.HawkBuilder; //导入依赖的package包/类
@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();
}
开发者ID:ArturVasilov,项目名称:AndroidSchool,代码行数:20,代码来源:AppDelegate.java
示例3: initConfigs
import com.orhanobut.hawk.HawkBuilder; //导入依赖的package包/类
/**
* 初始化配置信息
*
* @param isDebugMode 是否是开发模式
*/
private void initConfigs(boolean isDebugMode) {
// 友盟在线参数调式模式:开启
OnlineConfigAgent.getInstance().setDebugMode(isDebugMode);
// 友盟统计调式模式:开启
MobclickAgent.setDebugMode(isDebugMode);
// Initialize JPush
JPushInterface.setDebugMode(isDebugMode); // 设置开启日志,发布时需关闭日志
if (isDebugMode) { // 开发模式
Logger
.init(TAG) // default PRETTYLOGGER or use just init()
.setMethodCount(3) // default 2
.hideThreadInfo() // default shown
.setLogLevel(LogLevel.FULL); // default LogLevel.FULL | LogLevel.NONE
// Initialize the hawk
Hawk.init(this)
.setEncryptionMethod(HawkBuilder.EncryptionMethod.MEDIUM)
.setStorage(HawkBuilder.newSqliteStorage(this))
.setLogLevel(com.orhanobut.hawk.LogLevel.FULL)
.build();
} else {
Logger
.init(TAG) // default PRETTYLOGGER or use just init()
.setMethodCount(3) // default 2
.hideThreadInfo() // default shown
.setLogLevel(LogLevel.NONE); // default LogLevel.FULL | LogLevel.NONE
// Initialize the hawk
Hawk.init(this)
.setEncryptionMethod(HawkBuilder.EncryptionMethod.MEDIUM)
.setStorage(HawkBuilder.newSqliteStorage(this))
.setLogLevel(com.orhanobut.hawk.LogLevel.NONE)
.build();
}
}
开发者ID:LegendKe,项目名称:MyTravelingDiary,代码行数:42,代码来源:XKApplication.java
示例4: HawkStorage
import com.orhanobut.hawk.HawkBuilder; //导入依赖的package包/类
public HawkStorage(@NonNull Context context) {
Hawk.init(context)
.setEncryptionMethod(HawkBuilder.EncryptionMethod.MEDIUM)
.setStorage(HawkBuilder.newSharedPrefStorage(context))
.setLogLevel(BuildConfig.DEBUG ? LogLevel.FULL : LogLevel.NONE)
.build();
}
开发者ID:ArturVasilov,项目名称:AndroidArchitecture,代码行数:8,代码来源:HawkStorage.java
示例5: initStorage
import com.orhanobut.hawk.HawkBuilder; //导入依赖的package包/类
private void initStorage() {
Hawk
.init(this)
.setEncryptionMethod(HawkBuilder.EncryptionMethod.NO_ENCRYPTION)
.setStorage(HawkBuilder.newSharedPrefStorage(this))
.setLogLevel(appDebug ? LogLevel.FULL : LogLevel.NONE)
.build();
}
开发者ID:vihuela,项目名称:Lay-s,代码行数:9,代码来源:CommonApplication.java
示例6: onCreate
import com.orhanobut.hawk.HawkBuilder; //导入依赖的package包/类
@Override public void onCreate() {
super.onCreate();
appComponent = DaggerAppComponent.builder().appModule(new AppModule(this)).build();
appComponent.inject(this);
Hawk.init(this)
.setStorage(HawkBuilder.newSqliteStorage(this))
.setLogLevel(LogLevel.FULL)
.setEncryptionMethod(HawkBuilder.EncryptionMethod.NO_ENCRYPTION)
.build();
}
开发者ID:pkliang,项目名称:gankmaku,代码行数:12,代码来源:App.java
示例7: onCreate
import com.orhanobut.hawk.HawkBuilder; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Button button = (Button) findViewById(R.id.start_button);
final TextView textView = (TextView) findViewById(R.id.results);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
final StringBuilder sb = new StringBuilder();
button.setEnabled(false);
new AsyncTask<Void, Void, Void>() {
public Void doInBackground(Void... args) {
KV kv;
kv = new KV(
new SharedPrefsStorage(MainActivity.this, "kv"),
new SerializedEncoder());
benchKV("SharedPrefs/Serialized", kv, sb);
publishProgress();
kv = new KV(
new SharedPrefsStorage(MainActivity.this, "kv"),
new GsonEncoder());
benchKV("SharedPrefs/Gson", kv, sb);
publishProgress();
kv = new KV(
new SqliteStorage(MainActivity.this, "kv"),
new SerializedEncoder());
benchKV("Sqlite/Serialized", kv, sb);
publishProgress();
kv = new KV(
new SqliteStorage(MainActivity.this, "kv"),
new GsonEncoder());
benchKV("Sqlite/Gson", kv, sb);
publishProgress();
kv = new KV(
new LruStorage(new SqliteStorage(MainActivity.this, "kv"),
ITERATIONS),
new SerializedEncoder());
benchKV("Sqlite+LRU/Serialized", kv, sb);
publishProgress();
kv = new KV(
new LruStorage(new SqliteStorage(MainActivity.this, "kv"),
ITERATIONS),
new GsonEncoder());
benchKV("Sqlite+LRU/Gson", kv, sb);
publishProgress();
Hawk.init(MainActivity.this)
.setStorage(HawkBuilder.newSharedPrefStorage(MainActivity.this))
.build();
benchHawk("Hawk/SharedPrefs", sb);
Hawk.clear();
publishProgress();
Hawk.init(MainActivity.this)
.setStorage(HawkBuilder.newSqliteStorage(MainActivity.this))
.build();
benchHawk("Hawk/Sqlite", sb);
publishProgress();
Hawk.clear();
return null;
}
public void onProgressUpdate(Void... values) {
textView.setText(sb.toString());
}
public void onPostExecute(Void result) {
button.setEnabled(true);
}
}.execute();
}
});
}
开发者ID:trikita,项目名称:kv,代码行数:81,代码来源:MainActivity.java
示例8: onCreate
import com.orhanobut.hawk.HawkBuilder; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
//Bad static initializers.
SugarContext.init(this);
Once.initialise(this);
Hawk.init(this)
.setEncryptionMethod(HawkBuilder.EncryptionMethod.NO_ENCRYPTION)
.setStorage(HawkBuilder.newSqliteStorage(this))
.setLogLevel(LogLevel.FULL)
.build();
vaporAppComponent = VaporAppComponent.Initializer.init(this);
uiComponent = DaggerUiComponent.builder()
.vaporAppComponent(vaporAppComponent)
.build();
vaporAppComponent.inject(this);
registerBus();
initStetho();
if (BuildConfig.DEBUG) {
//When debugging logs will go through the Android logger
Timber.plant(new Timber.DebugTree());
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectCustomSlowCalls()
.detectDiskReads()
.detectDiskWrites()
.penaltyLog()
.build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectActivityLeaks()
.penaltyLog()
.build());
}
Thread.setDefaultUncaughtExceptionHandler(new CrashHandler(this));
}
开发者ID:tevjef,项目名称:Vapor,代码行数:45,代码来源:VaporApp.java
注:本文中的com.orhanobut.hawk.HawkBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论