本文整理汇总了Java中com.crashlytics.android.ndk.CrashlyticsNdk类的典型用法代码示例。如果您正苦于以下问题:Java CrashlyticsNdk类的具体用法?Java CrashlyticsNdk怎么用?Java CrashlyticsNdk使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CrashlyticsNdk类属于com.crashlytics.android.ndk包,在下文中一共展示了CrashlyticsNdk类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.crashlytics.android.ndk.CrashlyticsNdk; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
long start = System.currentTimeMillis();
Fabric.with(this, new Crashlytics(), new CrashlyticsNdk());
long end = System.currentTimeMillis();
Log.e("time:", (end - start) + "");
// Appsee.start(getString(R.string.com_appsee_apikey));
// 自定义log
// Crashlytics.log("Higgs-Boson detected! Bailing out...");
// // 自定义key
// Crashlytics.setInt("current_level", 3);
// Crashlytics.setString("last_UI_action", "fffff");
//
//
// testNativeCrash();
}
示例2: onCreate
import com.crashlytics.android.ndk.CrashlyticsNdk; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics(), new CrashlyticsNdk());
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
}
示例3: onCreate
import com.crashlytics.android.ndk.CrashlyticsNdk; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Crashlytics crashlyticsKit = new Crashlytics.Builder()
.core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
.build();
Fabric.with(this, crashlyticsKit, new CrashlyticsNdk());
Timber.plant(new CrashlyticsTree());
// Stash application context, then check to see if we need to restore things, and do so if necessary.
INSTANCE = this;
Realm.init(this);
BackupUtils.restoreRealmFileIfApplicable();
// Get global instances of certain classes.
this.prefs = new Prefs(PreferenceManager.getDefaultSharedPreferences(this));
this.d = new D(this);
// Set up EventBus to use the generated index.
EventBus.builder().addIndex(new EventBusIndex()).installDefaultEventBus();
// Init Dexter.
Dexter.initialize(this);
// Init Ruqus.
Ruqus.init(this);
// Do first time init if needed.
doFirstTimeInitIfNeeded();
// Set up default RealmConfiguration.
Realm.setDefaultConfiguration(new RealmConfiguration.Builder()
.name(REALM_FILE_NAME)
.schemaVersion(REALM_SCHEMA_VERSION)
.migration(new RealmMigrator())
.initialData(this::initialRealmData)
.build());
// Do init that requires Realm. This also serves the purpose of allowing us to check and see if a DB restore
// was successful (if one was performed).
try (Realm realm = Realm.getDefaultInstance()) {
// Initialize default unique ID factory.
UniqueIdFactory.getInstance().initializeDefault(realm);
// We got through Realm initialization, so we're good to delete the temporary Realm file that might exist
// if we just restored the Realm.
BackupUtils.removeTempRealmFile();
// Validate a few things now that we've successfully restored the Realm DB.
BackupUtils.doPostRestoreValidations(realm, prefs);
} catch (RealmFileException e) {
// We failed to open the restored Realm file, so try to roll back the changes.
BackupUtils.rollBackFromDBRestore();
// Try to do init again. If this still fails...well, I'm not really sure to be honest :(
try (Realm realm = Realm.getDefaultInstance()) {
// Initialize default unique ID factory.
UniqueIdFactory.getInstance().initializeDefault(realm);
}
}
// Trigger auto-import if needed.
if (prefs.isLibAutoImport(false)) Importer.get().queueFullImport();
// Send event to have MainActivity trigger "Rate Minerva" dialog if need be.
if (prefs.shouldShowRateMeDialog()) EventBus.getDefault().postSticky(new ShowRateMeDialogEvent());
}
示例4: onCreate
import com.crashlytics.android.ndk.CrashlyticsNdk; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Fabric.with( this, new Crashlytics(), new CrashlyticsNdk() );
Instance = this;
// Stetho.initialize(Stetho.newInitializerBuilder(this).enableDumpapp(
// Stetho.defaultDumperPluginsProvider(this)).enableWebKitInspector(Stetho.defaultInspectorModulesProvider(
// this)).build());
TaskHelper.init( getApplicationContext() );
Prefs.createInstance( this );
Properties prop = new Properties();
InputStream input = null;
try {
/*From "resources".*/
input = getClassLoader().getResourceAsStream( "key.properties" );
if( input != null ) {
// load a properties file
prop.load( input );
mApiKey = prop.getProperty( "appkey" );
mSenderId = prop.getProperty( "senderId" );
Bmob.initialize( this, prop.getProperty( "bmobkey" ) );
}
} catch( IOException ex ) {
mApiKey = null;
} finally {
if( input != null ) {
try {
input.close();
} catch( IOException e ) {
e.printStackTrace();
}
}
}
Api.initialize( this, "http://www.faroo.com/" );
String url = Prefs.getInstance().getAppDownloadInfo();
if( TextUtils.isEmpty( url ) || !url.contains( "tinyurl" ) ) {
com.tinyurl4j.Api.getTinyUrl( getString( R.string.lbl_store_url, getPackageName() ), new Callback<Response>() {
@Override
public void success( Response response, retrofit.client.Response response2 ) {
Prefs.getInstance().setAppDownloadInfo(
getString( R.string.lbl_share_download_app, getString( R.string.application_name ), response.getResult() ) );
}
@Override
public void failure( RetrofitError error ) {
Prefs.getInstance().setAppDownloadInfo( getString( R.string.lbl_share_download_app, getString( R.string.application_name ),
getString( R.string.lbl_store_url, getPackageName() )
) );
}
} );
}
}
示例5: onCreate
import com.crashlytics.android.ndk.CrashlyticsNdk; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Fabric.with(this, new Crashlytics(), new CrashlyticsNdk());
Core.init(this);
}