本文整理匯總了Java中com.crashlytics.android.core.CrashlyticsCore類的典型用法代碼示例。如果您正苦於以下問題:Java CrashlyticsCore類的具體用法?Java CrashlyticsCore怎麽用?Java CrashlyticsCore使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
CrashlyticsCore類屬於com.crashlytics.android.core包,在下文中一共展示了CrashlyticsCore類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: build
import com.crashlytics.android.core.CrashlyticsCore; //導入依賴的package包/類
public Crashlytics build() {
if (this.coreBuilder != null) {
if (this.core != null) {
throw new IllegalStateException("Must not use Deprecated methods delay(), disabled(), listener(), pinningInfoProvider() with core()");
}
this.core = this.coreBuilder.build();
}
if (this.answers == null) {
this.answers = new Answers();
}
if (this.beta == null) {
this.beta = new Beta();
}
if (this.core == null) {
this.core = new CrashlyticsCore();
}
return new Crashlytics(this.answers, this.beta, this.core);
}
示例2: init
import com.crashlytics.android.core.CrashlyticsCore; //導入依賴的package包/類
public static void init(Context context) {
if (sInitialized) {
return;
}
sInitialized = true;
Crashlytics crashlyticsKit = new Crashlytics.Builder()
.core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
.build();
Fabric.with(context, crashlyticsKit);
FontProviderSettings.init(context);
FontManager.init(context);
}
示例3: onCreate
import com.crashlytics.android.core.CrashlyticsCore; //導入依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
//Fabric.with(this, new Crashlytics());
// Set up Crashlytics, disabled for debug builds
Crashlytics crashlyticsKit = new Crashlytics.Builder()
.core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
.build();
// Initialize Fabric with the debug-disabled crashlytics.
Fabric.with(this, crashlyticsKit);
// Required initialization logic here!
mConnectivityChangesDetector = new ConnectivityChangesDetector();
mIntentFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
registerReceiver(mConnectivityChangesDetector,mIntentFilter);
}
示例4: onCreate
import com.crashlytics.android.core.CrashlyticsCore; //導入依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
Stetho.initializeWithDefaults(this);
CrashlyticsCore core = new CrashlyticsCore.Builder()
.disabled(BuildConfig.DEBUG)
.build();
Fabric.with(this, new Crashlytics.Builder().core(core).build(), new Crashlytics());
// ...
if (BuildConfig.DEBUG) {
Timber.plant(new Timber.DebugTree());
}
Timber.plant(new CrashlyticsTree());
MainApp.init(getBaseContext());
}
示例5: onCreate
import com.crashlytics.android.core.CrashlyticsCore; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState, int layoutId) {
super.onCreate(savedInstanceState, layoutId);
if(Fabric.isInitialized())
CrashlyticsCore.getInstance().log(getClass().getName() + " onCreate");
if(!VersionUtils.isUsingCorrectBuild()) {
new AlertDialog.Builder(this)
.setMessage(pct.droid.base.R.string.wrong_abi)
.setCancelable(false)
.show();
PopcornUpdater.getInstance(this, new PopcornUpdater.Listener() {
@Override
public void updateAvailable(String updateFile) {
Intent installIntent = new Intent(Intent.ACTION_VIEW);
installIntent.setDataAndType(Uri.parse("file://" + updateFile), PopcornUpdater.ANDROID_PACKAGE);
installIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(installIntent);
}
}).checkUpdatesManually();
}
}
示例6: onCreate
import com.crashlytics.android.core.CrashlyticsCore; //導入依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
// Context
MiitaContext.onCreateApplication(getApplicationContext());
// Fabric
final Crashlytics crashlytics = new Crashlytics.Builder()
.core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
.build();
Fabric.with(this, crashlytics);
// Realm
RealmConfiguration config = new RealmConfiguration.Builder(this).build();
Realm.setDefaultConfiguration(config);
}
示例7: onCreate
import com.crashlytics.android.core.CrashlyticsCore; //導入依賴的package包/類
@Override
public void onCreate(){
super.onCreate();
//di
component = DaggerApplicationComponent.builder().applicationModule(new ApplicationModule(this)).build();
//Crashlytics
CrashlyticsCore core = new CrashlyticsCore.Builder()
.disabled(BuildConfig.DEBUG)
.build();
Fabric.with(this, new Crashlytics.Builder().core(core).build());
if (BuildConfig.DEBUG) {
Timber.plant(new Timber.DebugTree());
} else {
Timber.plant(new CrashReportTree());
}
}
示例8: initFabric
import com.crashlytics.android.core.CrashlyticsCore; //導入依賴的package包/類
private void initFabric(Context context) {
if (!BuildConfig.BUILD_TYPE.equalsIgnoreCase("debug")) {
//Timber.plant(new CrashlyticsLogExceptionTree());
Timber.plant(new CrashlyticsLogTree(Log.INFO));
}
Crashlytics crashlyticsKit = new Crashlytics.Builder().core(
new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG && !BuildConfig.BUILD_TYPE.equals("staging"))
.build())
.build();
Fabric fabric = new Fabric.Builder(context).kits(crashlyticsKit)
.debuggable(BuildConfig.DEBUG)
.build();
Fabric.with(fabric);
Crashlytics.setUserIdentifier(Installation.id(context));
}
示例9: onCreate
import com.crashlytics.android.core.CrashlyticsCore; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
long curTime = System.currentTimeMillis();
Fabric.with(this, new Crashlytics.Builder().core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()).build(), new Crashlytics());
setContentView(R.layout.activity_main);
PermissionInfo permissionInfo = new PermissionInfo();
permissionInfo.getPermissions(this, new ResultCallback<Boolean>() {
@Override
public void onResult(Boolean result) {
isPermission=result;
if (result) {
if(getIntent().getBooleanExtra("PERMISSION", false)) finish();
else
load();
}
else finish();
}
});
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
示例10: log
import com.crashlytics.android.core.CrashlyticsCore; //導入依賴的package包/類
@Override
protected void log(int priority, String tag, String message, Throwable t) {
if (priority == Log.VERBOSE || priority == Log.DEBUG) {
return;
}
CrashlyticsCore.getInstance().log(priority, tag, message);
if (t != null) {
if (priority == Log.ERROR) {
CrashlyticsCore.getInstance().logException(t);
} else if (priority == Log.WARN) {
CrashlyticsCore.getInstance().log(t.getMessage());
}
}
}
示例11: onCreate
import com.crashlytics.android.core.CrashlyticsCore; //導入依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
httpClient = new OkHttpClient.Builder().build();
Crashlytics crashlytics = new Crashlytics.Builder()
.core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
.build();
final Fabric fabric = new Fabric.Builder(this)
.kits(crashlytics, new Answers())
.debuggable(BuildConfig.DEBUG)
.build();
Fabric.with(fabric);
if (BuildConfig.DEBUG) {
Timber.plant(new Timber.DebugTree());
} else {
Timber.plant(new CrashlyticsTree());
FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(true);
}
NightModeUtil.update(this);
// set user agent to prevent getting banned from the osm servers
Configuration.getInstance().load(this, PreferenceManager.getDefaultSharedPreferences(this));
}
示例12: onCreate
import com.crashlytics.android.core.CrashlyticsCore; //導入依賴的package包/類
public void onCreate() {
super.onCreate();
// Set up Crashlytics, disabled for debug builds
Crashlytics crashlyticsKit = new Crashlytics.Builder()
.core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
.build();
// Initialize Fabric with the debug-disabled crashlytics.
Fabric.with(this, crashlyticsKit);
PreferenceManager.setDefaultValues(getApplicationContext(), R.xml.preference_screen, false);
TranSappApplication.context = getApplicationContext();
Installation.loadUserId(context);
PositionProvider.instantiate(getApplicationContext());
}
示例13: onCreate
import com.crashlytics.android.core.CrashlyticsCore; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set up Crashlytics, disabled for debug builds
Crashlytics crashlyticsKit = new Crashlytics.Builder()
.core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
.build();
// Initialize Fabric with the debug-disabled crashlytics.
Fabric.with(this, crashlyticsKit, new Crashlytics());
setContentView(R.layout.activity_thought_shakeup);
PermissionInfo permissionInfo = new PermissionInfo();
permissionInfo.getPermissions(this, new ResultCallback<Boolean>() {
@Override
public void onResult(Boolean result) {
isPermission = result;
if (result)
load();
else finish();
}
});
}
示例14: getEnum
import com.crashlytics.android.core.CrashlyticsCore; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public <T extends Enum<?>> T getEnum(AppSetting setting)
{
Enum defEnum = (Enum) setting.getDefault();
String name = getStringByKey(setting.getKey());
if (name == null)
return (T) defEnum;
try
{
return (T) Enum.valueOf(defEnum.getClass(), name);
}
catch (IllegalArgumentException e)
{
CrashlyticsCore.getInstance().logException(e);
return (T) defEnum;
}
}
示例15: CrashReports
import com.crashlytics.android.core.CrashlyticsCore; //導入依賴的package包/類
/**
* init crash reports
*
* @param context activity context
*/
public CrashReports(Context context) {
Crashlytics crashlyticsKit = new Crashlytics.Builder().core(
new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG)
.build())
.build();
Fabric.with(context, crashlyticsKit);
}