當前位置: 首頁>>代碼示例>>Java>>正文


Java CrashReport類代碼示例

本文整理匯總了Java中com.tencent.bugly.crashreport.CrashReport的典型用法代碼示例。如果您正苦於以下問題:Java CrashReport類的具體用法?Java CrashReport怎麽用?Java CrashReport使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CrashReport類屬於com.tencent.bugly.crashreport包,在下文中一共展示了CrashReport類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import com.tencent.bugly.crashreport.CrashReport; //導入依賴的package包/類
@Override
    public void onCreate() {
//        boxStore = MyObjectBox.builder().androidContext(this).build();
        Context context = getApplicationContext();
// 獲取當前包名
        String packageName = context.getPackageName();
// 獲取當前進程名
        String processName = getProcessName(android.os.Process.myPid());
// 設置是否為上報進程
        CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(context);
        strategy.setUploadProcess(processName == null || processName.equals(packageName));
// 初始化Bugly
        Bugly.init(getApplicationContext(), "1d65abe1b1", false);
        Beta.initDelay = 1 * 1000;
//        Beta.upgradeDialogLayoutId = R.layout.upgrade_dialog;
        super.onCreate();
    }
 
開發者ID:htqqdd,項目名稱:music_player,代碼行數:18,代碼來源:MyApplication.java

示例2: onCreate

import com.tencent.bugly.crashreport.CrashReport; //導入依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();
    OkHttpClient okHttpClient = new OkHttpClient.Builder()
            .build();
    ImagePipelineConfig config = OkHttpImagePipelineConfigFactory.newBuilder(this, okHttpClient)
            .setMainDiskCacheConfig(getDiskCacheConfig())
            .setNetworkFetcher(new OkHttpNetworkFetcher(okHttpClient))
            .setDownsampleEnabled(true)
            .build();
    Fresco.initialize(this, config);

    Context context = getApplicationContext();
    String packageName = context.getPackageName();
    String processName = getProcessName(android.os.Process.myPid());
    CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(context);
    strategy.setUploadProcess(processName == null || processName.equals(packageName));
    CrashReport.initCrashReport(getApplicationContext(), "0a6e92fb70", false, strategy);

    registerActivityLifecycleCallbacks(ActivityLifecycleHelper.build());
}
 
開發者ID:lanyuanxiaoyao,項目名稱:PicKing,代碼行數:22,代碼來源:MyApplication.java

示例3: initBugly

import com.tencent.bugly.crashreport.CrashReport; //導入依賴的package包/類
private void initBugly(){

        Beta.initDelay = 6 * 1000;
        Beta.enableHotfix = false;
        Beta.canShowUpgradeActs.add(LoginActivity.class);
        Beta.canShowUpgradeActs.add(MainActivity.class);
        Beta.canShowUpgradeActs.add(AboutActivity.class);
        Beta.upgradeListener = UpgradeDialog.INSTANCE;

        CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(getApplicationContext());
        strategy.setAppVersion(BuildConfig.VERSION_NAME);
        strategy.setAppReportDelay(10 * 1000);
        Bugly.init(getApplicationContext(), AppConfig.BUGLY_APPID, BuildConfig.DEBUG, strategy);
        CrashReport.setIsDevelopmentDevice(getApplicationContext(), BuildConfig.DEBUG);

    }
 
開發者ID:ThirtyDegreesRay,項目名稱:OpenHub,代碼行數:17,代碼來源:AppApplication.java

示例4: onCreate

import com.tencent.bugly.crashreport.CrashReport; //導入依賴的package包/類
@Override
    public void onCreate() {
        super.onCreate();
        mAppComponent = DaggerAppComponent
                .builder()
                .appModule(getAppModule())//baseApplication提供
                .clientModule(getClientModule())//baseApplication提供
                .imageModule(getImageModule())//baseApplication提供
                .globeConfigModule(getGlobeConfigModule())//全局配置
                .serviceModule(new ServiceModule())//需自行創建
                .cacheModule(new CacheModule())//需自行創建
                .build();

        if (BuildConfig.LOG_DEBUG) {//Timber日誌打印
            Timber.plant(new Timber.DebugTree());
        }

//        installLeakCanary();//leakCanary內存泄露檢查
        initUMPush();

        //bugly
        CrashReport.initCrashReport(getApplicationContext(), "487e5e6b5d", false);
    }
 
開發者ID:snowwolf10285,項目名稱:PicShow-zhaipin,代碼行數:24,代碼來源:WEApplication.java

示例5: onCreate

import com.tencent.bugly.crashreport.CrashReport; //導入依賴的package包/類
@Override
    public void onCreate() {
        super.onCreate();
        ViewTarget.setTagId(R.id.glide_tag);
        isInstallWx = isWXAppInstalledAndSupported();

        //alibaba
        System.loadLibrary("gnustl_shared");
//        System.loadLibrary("ijkffmpeg");//目前使用微博的ijkffmpeg會出現1K再換wifi不重連的情況
        System.loadLibrary("qupai-media-thirdparty");
//        System.loadLibrary("alivc-media-jni");
        System.loadLibrary("qupai-media-jni");
        ApplicationGlue.initialize(this);

        //Bugly SDK初始化
        CrashReport.initCrashReport(getApplicationContext(), "3080098224", false);
    }
 
開發者ID:JunGeges,項目名稱:AliZhiBoHao,代碼行數:18,代碼來源:MyApplication.java

示例6: onCreate

import com.tencent.bugly.crashreport.CrashReport; //導入依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();

    mContext = getApplicationContext();

    //初始化 Bugly
    CrashReport.initCrashReport(getApplicationContext(), StaticClass.BUGLY_APP_ID, true);

    //初始化 Bmob
    Bmob.initialize(this, StaticClass.BMOB_APP_ID);

    //初始化語音識別
    SpeechUtility.createUtility(getApplicationContext(), SpeechConstant.APPID + "=" +
            StaticClass.VOICE_KEY);

    //初始化百度地圖
    SDKInitializer.initialize(getApplicationContext());

    //初始化litepal
    LitePalApplication.initialize(getApplicationContext());
}
 
開發者ID:Hultron,項目名稱:LifeHelper,代碼行數:23,代碼來源:BaseApplication.java

示例7: onCreate

import com.tencent.bugly.crashreport.CrashReport; //導入依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();
    CrashReport.initCrashReport(getApplicationContext(), "9da27d3d6b", false);
    initOSS();

    //初始化定位
    mLocationClient = new AMapLocationClient(getApplicationContext());
    //設置定位回調監聽
    mLocationClient.setLocationListener(mLocationListener);

    mLocationOption = new AMapLocationClientOption();
    mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
    mLocationOption.setMockEnable(false);
    mLocationClient.setLocationOption(mLocationOption);
    mLocationClient.startLocation();
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:18,代碼來源:initApp.java

示例8: onCreate

import com.tencent.bugly.crashreport.CrashReport; //導入依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();
    CrashReport.initCrashReport(getApplicationContext(), "e1a62089c6", false);
    ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this)
            .setProgressiveJpegConfig(new SimpleProgressiveJpegConfig())
            .build();
    Fresco.initialize(this, config);
    SDKInitializer.initialize(this);
    Bmob.initialize(this, "b0cb494256d9b86fc931ca930a055b75");
    Logger.addLogAdapter(new AndroidLogAdapter(){
        @Override
        public boolean isLoggable(int priority, String tag) {
            return true;// TODO: 2017/6/5
        }
    });
    sInstance = this;
    initUser();
}
 
開發者ID:yiwent,項目名稱:Mobike,代碼行數:20,代碼來源:MyApplication.java

示例9: onCreate

import com.tencent.bugly.crashreport.CrashReport; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //bugly crashreport
    CrashReport.initCrashReport(this, "e1e86d29bc", true);
    //webview debug
    if ((0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE))
            && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        WebView.setWebContentsDebuggingEnabled(true);
    }
    setContentView(R.layout.activity_sample);
    try {
        ApplicationInfo appInfo = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA);
        mBingKey = appInfo.metaData.getString("BING_MAP_KEY");
        mClientId = appInfo.metaData.getString("FOURSQUARE_CLIENT_ID");
        mClientSecret = appInfo.metaData.getString("FOURSQUARE_CLIENT_SECRET");
    } catch (PackageManager.NameNotFoundException e) {
    }
    mIvLocation = findViewById(R.id.iv_location);
    mLvPoi = findViewById(R.id.lv_poi);
    mAdapter = new PoiListAdapter();
    mLvPoi.setAdapter(mAdapter);
    mLvPoi.setOnItemClickListener(this);
}
 
開發者ID:bravecheng,項目名稱:BingMapDemo,代碼行數:25,代碼來源:SampleActivity.java

示例10: onCreate

import com.tencent.bugly.crashreport.CrashReport; //導入依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();
    // Bugly initial
    CrashReport.initCrashReport(getApplicationContext(), mCrashReportId, false);

    // LeakCanary initial
    LeakCanary.install(this);

    // Realm initial
    Realm.setDefaultConfiguration(new RealmConfiguration.Builder(this)
            .schemaVersion(1)
            .deleteRealmIfMigrationNeeded()
            .build());

    // Gson initial
    initGson();

    // switch day and night mode
    String mode = PrefsUtil.getPrefDayNightMode(this);
    PrefsUtil.switchDayNightMode(mode);
}
 
開發者ID:yansha87,項目名稱:douban-movie,代碼行數:23,代碼來源:MovieApplication.java

示例11: onCreate

import com.tencent.bugly.crashreport.CrashReport; //導入依賴的package包/類
@Override
    public void onCreate() {
        super.onCreate();
        appContext = this;
        //SDK初始化
        IMClient.init(appContext);
//        AVClient.init(this);

        LogFileUtil.isWrite=true;
        CrashReport.initCrashReport(appContext);
        appKeyInit();
        reloginCallBack();
        //agora
        Crasheye.initWithNativeHandle(this, "06798b00");
        //volley
        mRequestQueue = Volley.newRequestQueue(appContext);
        mApi = new ApiTemplate(mRequestQueue, httpConfig.URL);
        initlocation();
    }
 
開發者ID:yun2win,項目名稱:yun2win-sdk-android,代碼行數:20,代碼來源:AppContext.java

示例12: onCreate

import com.tencent.bugly.crashreport.CrashReport; //導入依賴的package包/類
@Override
    public void onCreate() {
        super.onCreate();
//        AVOSCloud.useAVCloudUS();//
        CrashReport.initCrashReport(getApplicationContext(), "900020615", false);
//        CrashReport.testJavaCrash();
        AVOSCloud.initialize(this, "6vNrCi5ou4rw5sb0fx8b0J4w-gzGzoHsz", "zfuBYXx8X235VVi6O7acOM8G");
        AVInstallation.getCurrentInstallation().saveInBackground(new SaveCallback() {
            public void done(AVException e) {
                if (e == null) {
                    // 保存成功
                    String installationId = AVInstallation.getCurrentInstallation().getInstallationId();
                    // 關聯  installationId 到用戶表等操作……
                } else {
                    // 保存失敗,輸出錯誤信息
                }
            }
        });
        PushService.setDefaultPushCallback(this, UpdateActivity.class);
    }
 
開發者ID:JianxunRao,項目名稱:FangYanShuo,代碼行數:21,代碼來源:MyApplication.java

示例13: onCreate

import com.tencent.bugly.crashreport.CrashReport; //導入依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();

    // LeakCanary
    if (LeakCanary.isInAnalyzerProcess(this)) {
        return;
    }
    LeakCanary.install(this);

    instance = this;

    // Bugly
    CrashReport.initCrashReport(getApplicationContext(), "900057697", true);

    SharedPreferences preferences = getSharedPreferences(DAY_NIGHT_MODE, MODE_PRIVATE);
    changeDayNightMode(preferences.getBoolean(NIGHT_MODE, false));

    Realm.init(this);
    Realm.setDefaultConfiguration(new RealmConfiguration.Builder().name(DB_NAME).build());

    getScreenSize();
}
 
開發者ID:Codpoe,項目名稱:GankIo,代碼行數:24,代碼來源:GankIoApplication.java

示例14: onCreate

import com.tencent.bugly.crashreport.CrashReport; //導入依賴的package包/類
@Override
public void onCreate() {

  super.onCreate();
  mAppContext = this;
  // 配置Realm數據庫
  RealmConfiguration configuration = new RealmConfiguration
      .Builder(this)
      .deleteRealmIfMigrationNeeded()
      .schemaVersion(6)
      .migration(new RealmMigration() {

        @Override
        public void migrate(DynamicRealm realm, long oldVersion, long newVersion) {

        }
      }).build();

  Realm.setDefaultConfiguration(configuration);

  //配置騰訊bugly
  CrashReport.initCrashReport(getApplicationContext(), ConstantUtil.BUGLY_ID, false);
}
 
開發者ID:HotBitmapGG,項目名稱:MoeQuest,代碼行數:24,代碼來源:MoeQuestApp.java

示例15: onCreate

import com.tencent.bugly.crashreport.CrashReport; //導入依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();
    mAppContext = getApplicationContext();
    CrashHandler.init(new CrashHandler(getApplicationContext()));
    if (!BuildConfig.DEBUG) {
        CrashReport.initCrashReport(getApplicationContext(), "900028220", false);
    }
    //BlockCanary.install(this, new AppBlockCanaryContext()).start();
    //LeakCanary.install(this);

    //RxUtils.unifiedErrorHandler();
    //Thread.setDefaultUncaughtExceptionHandler(new MyUnCaughtExceptionHandler());
    /**
     * 如果存在SD卡則將緩存寫入SD卡,否則寫入手機內存
     */
    if (getApplicationContext().getExternalCacheDir() != null && ExistSDCard()) {
        cacheDir = getApplicationContext().getExternalCacheDir().toString();
    } else {
        cacheDir = getApplicationContext().getCacheDir().toString();
    }
}
 
開發者ID:JasonChow1989,項目名稱:SeeWeather-master,代碼行數:23,代碼來源:BaseApplication.java


注:本文中的com.tencent.bugly.crashreport.CrashReport類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。