本文整理匯總了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();
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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();
}
示例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);
}
示例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();
}
}