当前位置: 首页>>代码示例>>Java>>正文


Java CrashlyticsNdk类代码示例

本文整理汇总了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();
    }
 
开发者ID:devilWwj,项目名称:Android-Tech,代码行数:21,代码来源:MainActivity.java

示例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);
}
 
开发者ID:shwenzhang,项目名称:AndResGuard,代码行数:28,代码来源:MainActivity.java

示例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());
}
 
开发者ID:bkromhout,项目名称:Minerva,代码行数:63,代码来源:Minerva.java

示例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() )
				) );
			}
		} );
	}
}
 
开发者ID:XinyueZ,项目名称:cusnews,代码行数:60,代码来源:App.java

示例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);
}
 
开发者ID:dsaved,项目名称:africhat-platform-0.1,代码行数:7,代码来源:ActorApplication.java


注:本文中的com.crashlytics.android.ndk.CrashlyticsNdk类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。