本文整理汇总了Java中io.fabric.sdk.android.Fabric类的典型用法代码示例。如果您正苦于以下问题:Java Fabric类的具体用法?Java Fabric怎么用?Java Fabric使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Fabric类属于io.fabric.sdk.android包,在下文中一共展示了Fabric类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import io.fabric.sdk.android.Fabric; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics());
setContentView(R.layout.activity_splash);
new Handler().postDelayed(new Runnable() {
/*
* Showing splash screen with a timer. This will be useful when you
* want to show case your app logo / company
*/
@Override
public void run() {
// This method will be executed once the timer is over
// Start your app main activity
Intent i = new Intent(SplashActivity.this, MainActivity.class);
startActivity(i);
// close this activity
finish();
}
}, SPLASH_TIME_OUT);
}
示例2: onCreate
import io.fabric.sdk.android.Fabric; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics());
HomeViewModel viewModel = new HomeViewModel();
viewModel.carregarPagamentosFromString(ServicoBoleto.buscarPagamentos(this));
ActivityHomeBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_home);
binding.setHomeVModel(viewModel);
Toolbar toolbar = binding.toolbar;
setSupportActionBar(toolbar);
requestCameraPermission();
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(HomeActivity.this, LerCodigoBarrasActivity.class));
// Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
// .setAction("Action", null).show();
}
});
}
示例3: onCreate
import io.fabric.sdk.android.Fabric; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Fabric.with(this, new Crashlytics());
injector =
DaggerMobSoftApplicationComponent.builder().
uIModule(
new UIModule(this)
).build();
injector.inject(this);
repository.open(getApplicationContext());
}
示例4: onCreate
import io.fabric.sdk.android.Fabric; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics());
setContentView(R.layout.activity_opponents);
initFields();
initDefaultActionBar();
initUi();
startLoadUsers();
if (isRunForCall && webRtcSessionManager.getCurrentSession() != null) {
CallActivity.start(OpponentsActivity.this, true);
}
checker = new PermissionsChecker(getApplicationContext());
}
示例5: onCreate
import io.fabric.sdk.android.Fabric; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics());
setContentView(R.layout.activity_registration);
auth = FirebaseAuth.getInstance();
appStatus=new AppStatus(getApplicationContext());
register = (Button) findViewById(R.id.btn_register);
existinguser = (Button) findViewById(R.id.existinguser);
edt_Password = (EditText) findViewById(R.id.edt_Rpassword);
edt_RePassword = (EditText) findViewById(R.id.edt_RRepassword);
edt_Email = (EditText) findViewById(R.id.edt_email);
progressBar=(ProgressBar)findViewById(R.id.progressBar);
register.setOnClickListener(this);
existinguser.setOnClickListener(this);
}
示例6: onCreate
import io.fabric.sdk.android.Fabric; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
if (BuildConfig.CRASH_REPORTS) {
Fabric.with(this, new Crashlytics());
}
INSTANCE = this;
// if(LeakCanary.isInAnalyzerProcess(this))
// return;
// LeakCanary.install(this);
FacebookSdk.sdkInitialize(getApplicationContext());
AppEventsLogger.activateApp(this);
UserToken.getInstance().initSharedPreferences(this);
}
示例7: getApiKeyFromManifest
import io.fabric.sdk.android.Fabric; //导入依赖的package包/类
protected String getApiKeyFromManifest(Context context) {
String apiKey = null;
try {
Bundle bundle = context.getPackageManager().getApplicationInfo(context.getPackageName(), 128).metaData;
if (bundle != null) {
apiKey = bundle.getString(FABRIC_API_KEY);
if (apiKey == null) {
Fabric.getLogger().d(Fabric.TAG, "Falling back to Crashlytics key lookup from Manifest");
apiKey = bundle.getString(CRASHLYTICS_API_KEY);
}
}
} catch (Exception e) {
Fabric.getLogger().d(Fabric.TAG, "Caught non-fatal exception while retrieving apiKey: " + e);
}
return apiKey;
}
示例8: onCreate
import io.fabric.sdk.android.Fabric; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
singleton = this;
TwitterAuthConfig authConfig = new TwitterAuthConfig(TWITTER_KEY, TWITTER_SECRET);
Fabric.with(this, new Twitter(authConfig));
Stetho.initializeWithDefaults(this);
}
示例9: IdManager
import io.fabric.sdk.android.Fabric; //导入依赖的package包/类
public IdManager(Context appContext, String appIdentifier, String appInstallIdentifier, Collection<Kit> kits) {
if (appContext == null) {
throw new IllegalArgumentException("appContext must not be null");
} else if (appIdentifier == null) {
throw new IllegalArgumentException("appIdentifier must not be null");
} else if (kits == null) {
throw new IllegalArgumentException("kits must not be null");
} else {
this.appContext = appContext;
this.appIdentifier = appIdentifier;
this.appInstallIdentifier = appInstallIdentifier;
this.kits = kits;
this.installerPackageNameProvider = new InstallerPackageNameProvider();
this.advertisingInfoProvider = new AdvertisingInfoProvider(appContext);
this.collectHardwareIds = CommonUtils.getBooleanResourceValue(appContext, COLLECT_DEVICE_IDENTIFIERS, true);
if (!this.collectHardwareIds) {
Fabric.getLogger().d(Fabric.TAG, "Device ID collection disabled for " + appContext.getPackageName());
}
this.collectUserIds = CommonUtils.getBooleanResourceValue(appContext, COLLECT_USER_IDENTIFIERS, true);
if (!this.collectUserIds) {
Fabric.getLogger().d(Fabric.TAG, "User information collection disabled for " + appContext.getPackageName());
}
}
}
示例10: onCreate
import io.fabric.sdk.android.Fabric; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Fabric.with(this, new Crashlytics());
Realm.init(this);
RealmConfiguration config = new RealmConfiguration.Builder()
.deleteRealmIfMigrationNeeded().
build();
Realm.setDefaultConfiguration(config);
FontsOverride.setDefaultFont(this, "DEFAULT", "fonts/questrial_regular.ttf");
// FontsOverride.setDefaultFont(this, "MONOSPACE", "fonts/quicksand_bold.ttf");
FontsOverride.setDefaultFont(this, "SERIF", "fonts/quicksand_regular.ttf");
FontsOverride.setDefaultFont(this, "serif", "fonts/quicksand_regular.ttf");
FontsOverride.setDefaultFont(this, "arial", "fonts/quicksand_regular.ttf");
// FontsOverride.setDefaultFont(this, "monospace", "fonts/quicksand_bold.ttf");
FontsOverride.setDefaultFont(this, "SANS_SERIF", "fonts/quicksand_bold.ttf");
Logger.d("tokenized");
try {
Logger.d(FirebaseInstanceId.getInstance().getToken());
setUser();
}catch (Exception e){
e.printStackTrace();
}
}
示例11: onCreate
import io.fabric.sdk.android.Fabric; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Fabric.with(this, new Crashlytics());
if (BuildConfig.DEBUG) {
StrictMode.enableDefaults();
Stetho.initialize(Stetho.newInitializerBuilder(this)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
.enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
.build());
}
Realm.init(this);
}
示例12: onCreate
import io.fabric.sdk.android.Fabric; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Fabric.with(this, new Crashlytics());
Prefs.initPrefs(this);
if (BuildConfig.DEBUG) {
Stetho.initializeWithDefaults(this);
}
FirebaseAnalytics analytics = FirebaseAnalytics.getInstance(this);
_myComponent = DaggerMyComponent.builder()
.myModule(new MyModule(this, analytics))
.build();
}
示例13: onCreate
import io.fabric.sdk.android.Fabric; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
TallyStackerApplication.instance = this;
JodaTimeAndroid.init(this);
Fabric.with(this, new Crashlytics());
Fabric.with(this, new Answers());
Stetho.initializeWithDefaults(this);
// Setup handler for uncaught exceptions.
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable e) {
if (!(e instanceof ExpectedElementNotFound))
handleUncaughtException(e);
}
});
}
示例14: onCreate
import io.fabric.sdk.android.Fabric; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics());
setContentView(R.layout.activity_base);
Realm.init(this);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
actionBar.setTitle("MultiCopy");
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(mViewPager);
}
示例15: logExceptionToFabric
import io.fabric.sdk.android.Fabric; //导入依赖的package包/类
public static void logExceptionToFabric(Throwable ex, String tag) {
if (ex == null) {
return;
}
try {
ex.printStackTrace();
} catch (StackOverflowError ignored) {
Crashlytics.log("StackOverflowError in Logger " + ignored);
return;
}
if (Fabric.isInitialized() && !TextUtils.isEmpty(ex.getMessage())) {
Crashlytics.logException(ex);
}
}