本文整理汇总了Java中io.fabric.sdk.android.Fabric.with方法的典型用法代码示例。如果您正苦于以下问题:Java Fabric.with方法的具体用法?Java Fabric.with怎么用?Java Fabric.with使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.fabric.sdk.android.Fabric
的用法示例。
在下文中一共展示了Fabric.with方法的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
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics());
setContentView(R.layout.activity_device_list);
ActionBar bar = getSupportActionBar();
if (bar != null) {
bar.setDisplayHomeAsUpEnabled(true);
}
this.deviceList = findViewById(R.id.listView);
try {
btScanner = new BluetoothScanner(this);
} catch (BluetoothNotSupportedException e) {
Toast.makeText(this, R.string.error_bluetooth_not_supported, Toast.LENGTH_SHORT).show();
finish();
}
}
示例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() {
super.onCreate();
//Fabric initialization for Crashlytics
Fabric.with(this, new Crashlytics());
//create component
mAppComponent = DaggerAppComponent.builder()
.utilsModule(new UtilsModule(this)).build();
//configure timber for logging
if (BuildConfig.DEBUG) {
Timber.plant(new Timber.DebugTree());
}
//calligraphy for fonts
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
.setDefaultFontPath("fonts/Roboto-Regular.ttf")
.setFontAttrId(R.attr.fontPath)
.build());
}
示例5: onCreate
import io.fabric.sdk.android.Fabric; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
initCastFunctionality();
if (!BuildConfig.DEBUG) {
try {
Fabric.with(this, new Crashlytics());
final Fabric fabric = new Fabric.Builder(this)
.kits(new Crashlytics())
.debuggable(true)
.build();
Fabric.with(fabric);
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例6: 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);
}
});
}
示例7: 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();
}
示例8: setup
import io.fabric.sdk.android.Fabric; //导入方法依赖的package包/类
public static void setup(Application application){
//Setup Fabric
Fabric.with(application, new Crashlytics());
//Setup amplitude
Amplitude.getInstance().initialize(application, BuildConfig.AMPLITUDE_SDK).enableForegroundTracking(application);
//Setup Facebook
FacebookSdk.sdkInitialize(application);
AppEventsLogger.activateApp(application);
}
示例9: errorHandler
import io.fabric.sdk.android.Fabric; //导入方法依赖的package包/类
private void errorHandler() {
Log.d(Constant.TAG, "error handler");
try {
Crashlytics crashlytics = new Crashlytics.Builder()
.core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
.build();
Fabric.with(this, crashlytics);
FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(BuildConfig.DEBUG);
} catch (Exception e) {
e.printStackTrace();
}
}
示例10: onCreate
import io.fabric.sdk.android.Fabric; //导入方法依赖的package包/类
@Override public void onCreate() {
super.onCreate();
FirebaseApp.initializeApp(this);
FirebaseDatabase.getInstance().setPersistenceEnabled(true);
Fabric.with(this, new Crashlytics());
this.initializeInjector();
this.initializeCalligraphy();
this.initializeLeakDetection();
}
示例11: initCrashReport
import io.fabric.sdk.android.Fabric; //导入方法依赖的package包/类
private static void initCrashReport(Context context) {
Crashlytics crashlyticsKit = new Crashlytics.Builder()
.core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
.build();
Fabric.with(context, crashlyticsKit);
}
示例12: onCreate
import io.fabric.sdk.android.Fabric; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (!BuildConfig.DEBUG) {
Fabric.with(this, new Crashlytics());
}
Intent intent = new Intent(this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
if (getIntent().getExtras() != null) {
intent.putExtras(getIntent().getExtras());
}
startActivity(intent);
finish();
}
示例13: onCreate
import io.fabric.sdk.android.Fabric; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Fabric.with(this, new Answers(), new Crashlytics());
session = new Session(this);
Fresco.initialize(this);
}
示例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_home);
bottomNavigationBar = (BottomNavigationBar) findViewById(R.id.bottom_navigation_bar);
fabHome = (FloatingActionButton) findViewById(R.id.fab_home);
modeSpinner = (Spinner) findViewById(R.id.mode_spinner);
bgSpinner = (Spinner) findViewById(R.id.bg_spinner);
shapeSpinner = (Spinner) findViewById(R.id.shape_spinner);
itemSpinner = (Spinner) findViewById(R.id.item_spinner);
autoHide = (CheckBox) findViewById(R.id.auto_hide);
toggleHide = (Button) findViewById(R.id.toggle_hide);
toggleBadge = (Button) findViewById(R.id.toggle_badge);
message = (TextView) findViewById(R.id.message);
fragment1 = TextFragmentKt.newTextFragmentInstance(getString(R.string.para1));
fragment2 = TextFragmentKt.newTextFragmentInstance(getString(R.string.para2));
fragment3 = TextFragmentKt.newTextFragmentInstance(getString(R.string.para3));
fragment4 = TextFragmentKt.newTextFragmentInstance(getString(R.string.para4));
fragment5 = TextFragmentKt.newTextFragmentInstance(getString(R.string.para5));
fragment6 = TextFragmentKt.newTextFragmentInstance(getString(R.string.para6));
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, Arrays.asList(new String[]{"MODE_DEFAULT", "MODE_FIXED", "MODE_SHIFTING", "MODE_FIXED_NO_TITLE", "MODE_SHIFTING_NO_TITLE"}));
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
modeSpinner.setAdapter(adapter);
modeSpinner.setSelection(2);
ArrayAdapter<String> itemAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, Arrays.asList(new String[]{"3 items", "4 items", "5 items"}));
itemAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
itemSpinner.setAdapter(itemAdapter);
itemSpinner.setSelection(2);
ArrayAdapter<String> shapeAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, Arrays.asList(new String[]{"SHAPE_OVAL", "SHAPE_RECTANGLE", "SHAPE_HEART", "SHAPE_STAR_3_VERTICES", "SHAPE_STAR_4_VERTICES", "SHAPE_STAR_5_VERTICES", "SHAPE_STAR_6_VERTICES"}));
shapeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
shapeSpinner.setAdapter(shapeAdapter);
shapeSpinner.setSelection(5);
ArrayAdapter<String> bgAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, Arrays.asList(new String[]{"BACKGROUND_STYLE_DEFAULT", "BACKGROUND_STYLE_STATIC", "BACKGROUND_STYLE_RIPPLE"}));
bgAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
bgSpinner.setAdapter(bgAdapter);
bgSpinner.setSelection(1);
modeSpinner.setOnItemSelectedListener(this);
bgSpinner.setOnItemSelectedListener(this);
shapeSpinner.setOnItemSelectedListener(this);
itemSpinner.setOnItemSelectedListener(this);
autoHide.setOnCheckedChangeListener(this);
toggleHide.setOnClickListener(this);
toggleBadge.setOnClickListener(this);
fabHome.setOnClickListener(this);
bottomNavigationBar.setTabSelectedListener(this);
}
示例15: 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_bridge_menu);
handler = new Handler();
mainLayout = (FrameLayout) findViewById(R.id.container);
preferences = PreferenceManager.getDefaultSharedPreferences(this);
editor = preferences.edit();
if (getSupportActionBar() != null) {
//updateActionBar(getResources().getString(R.string.actionbar_title));
updateActionBarLogo(isCameraMenuFragment);
}
// Only use for Eye VDJ
/*
View decor = this.getWindow().getDecorView();
decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE);
*/
rootMenu = new RootMenuFragment();
spotifyMenu = new SpotifyMenuFragment();
hueMenu = new HueMenuFragment();
vdjMenu = new VDJMenuFragment();
remoMenu = new RemoMenuFragment();
cameraMenu = new CameraMenuFragment();
interactionDisableTimer.setListener(this);
cancelTimer.setListener(this);
pauseTimer.setListener(this);
((PauseActionDetector) findViewById(R.id.interceptor)).setListaner(this);
basicConfigFragment = new BasicConfigFragment();
oscConfigFragment = new OSCConfigFragment();
midiConfigFragment = new MIDIConfigFragment();
spotifyConfigFragment = new SpotifyConfigFragment();
hueConfigFragment = new HueConfigFragment();
remoConfigFragment = new RemoConfigFragment();
aboutFragment = new AboutFragment();
/*
* MODIFY YOURSELF
* Add your implemented function's configuration
*
*/
// ***ConfigFragment = new ***ConfigFragment
FragmentManager manager = getSupportFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
transaction.add(R.id.container, rootMenu);
transaction.commit();
if (preferences.getBoolean("SHOW_WELCOME", true)) {
showWelcom();
} else {
if (Build.VERSION.SDK_INT >= 23) {
requestGPSPermission();
}
}
mNetworkStateReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (mPlayer != null) {
Connectivity connectivity = getNetworkConnectivity(context);
mPlayer.setConnectivityStatus(mOperationCallback, connectivity);
}
}
};
}