com.tencent.bugly.beta.Beta Java Examples
The following examples show how to use
com.tencent.bugly.beta.Beta.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BaseApplication.java From shinny-futures-android with GNU General Public License v3.0 | 6 votes |
/** * date: 2019/6/18 * author: chenli * description: 配置bugly */ private void initBugly(String BUGLY_KEY){ CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(sContext); strategy.setCrashHandleCallback(new CrashReport.CrashHandleCallback() { public Map<String, String> onCrashHandleStart(int crashType, String errorType, String errorMessage, String errorStack) { JSONObject jsonObject = new JSONObject(); try { jsonObject.put(AMP_EVENT_CRASH_TYPE, crashType); jsonObject.put(AMP_EVENT_ERROR_TYPE, errorType); jsonObject.put(AMP_EVENT_ERROR_MESSAGE, errorMessage); jsonObject.put(AMP_EVENT_ERROR_STACK, errorStack); } catch (JSONException e) { e.printStackTrace(); } Amplitude.getInstance().logEventWrap(AMP_CRASH, jsonObject); LinkedHashMap<String, String> map = new LinkedHashMap<>(); map.put("user-agent", sDataManager.USER_AGENT); return map; } }); Beta.enableHotfix = false; Bugly.init(sContext, BUGLY_KEY, false, strategy); }
Example #2
Source File: AboutActivity.java From FakeWeather with Apache License 2.0 | 6 votes |
public void onClick(View v) { switch (v.getId()) { case R.id.btn_web_home: WebUtils.openInternal(this, "https://github.com/li-yu/FakeWeather"); break; case R.id.btn_feedback: feedBack(); break; case R.id.btn_check_update: Beta.checkUpgrade(true, false); break; case R.id.btn_share_app: ShareUtils.shareText(this, "来不及了,赶紧上车!https://github.com/li-yu/FakeWeather", "分享到"); break; } }
Example #3
Source File: AppApplication.java From OpenHub with GNU General Public License v3.0 | 6 votes |
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.setAppChannel(getAppChannel()); strategy.setAppReportDelay(10 * 1000); Bugly.init(getApplicationContext(), AppConfig.BUGLY_APPID, BuildConfig.DEBUG, strategy); CrashReport.setIsDevelopmentDevice(getApplicationContext(), BuildConfig.DEBUG); }
Example #4
Source File: AboutActivity.java From NewFastFrame with Apache License 2.0 | 6 votes |
@Override protected void initData() { PackageInfo packageInfo = AppUtil.getPackageInfo(); version.setText(packageInfo.versionName); desc.setText("倾、听、看"); name.setText("简倾"); ToolBarOption toolBarOption = new ToolBarOption(); toolBarOption.setNeedNavigation(true); toolBarOption.setTitle("关于简倾"); setToolBar(toolBarOption); UpgradeInfo upgradeInfo = Beta.getUpgradeInfo(); if (upgradeInfo != null) { versionDesc.setText("立即更新"); } else { versionDesc.setText("已是最新版本"); } }
Example #5
Source File: AppSettingActivity.java From DanDanPlayForAndroid with MIT License | 6 votes |
@Override public void onClick(View v) { switch (v.getId()) { case R.id.path_rl: new FileManagerDialog(this, FileManagerDialog.SELECT_FOLDER, path -> { pathTv.setText(path); AppConfig.getInstance().setDownloadFolder(path); }).hideDefault().show(); break; case R.id.version_rl: Beta.checkUpgrade(false, false); break; case R.id.patch_rl: SophixManager.getInstance().queryAndLoadNewPatch(); break; case R.id.about_rl: Intent intent_about = new Intent(AppSettingActivity.this, WebViewActivity.class); intent_about.putExtra("title", "关于我们"); intent_about.putExtra("link", "file:///android_asset/DanDanPlay.html"); startActivity(intent_about); break; case R.id.feedback_rl: launchActivity(FeedbackActivity.class); break; } }
Example #6
Source File: MainActivity.java From Bugly-Android-Demo with Apache License 2.0 | 6 votes |
@Override public void onClick(View v) { switch (v.getId()) { case R.id.btnShowToast: // 测试热更新功能 testToast(); break; case R.id.btnKillSelf: // 杀死进程 android.os.Process.killProcess(android.os.Process.myPid()); break; case R.id.btnLoadPatch: // 本地加载补丁测试 Beta.applyTinkerPatch(getApplicationContext(), Environment.getExternalStorageDirectory().getAbsolutePath() + "/patch_signed_7zip.apk"); break; case R.id.btnLoadLibrary: // 本地加载so库测试 NativeCrashJni.getInstance().createNativeCrash(); break; case R.id.btnDownloadPatch: Beta.downloadPatch(); break; case R.id.btnPatchDownloaded: Beta.applyDownloadedPatch(); break; case R.id.btnCheckUpgrade: Beta.checkUpgrade(); break; } }
Example #7
Source File: MainActivity.java From Bugly-Android-Demo with Apache License 2.0 | 5 votes |
@Override public void onBackPressed() { super.onBackPressed(); Log.e("MainActivity", "onBackPressed"); Beta.unInit(); }
Example #8
Source File: MainActivity.java From Bugly-Android-Demo with Apache License 2.0 | 5 votes |
@Override public void onClick(View v) { switch (v.getId()) { case R.id.btnShowToast: // 测试热更新功能 testToast(); break; case R.id.btnKillSelf: // 杀死进程 android.os.Process.killProcess(android.os.Process.myPid()); break; case R.id.btnLoadPatch: // 本地加载补丁测试 Beta.applyTinkerPatch(getApplicationContext(), Environment.getExternalStorageDirectory().getAbsolutePath() + "/patch_signed_7zip.apk"); break; case R.id.btnLoadLibrary: // 本地加载so库测试 TestJNI testJNI = new TestJNI(); testJNI.createANativeCrash(); break; case R.id.btnDownloadPatch: Beta.downloadPatch(); break; case R.id.btnPatchDownloaded: Beta.applyDownloadedPatch(); break; case R.id.btnCheckUpgrade: Beta.checkUpgrade(); break; } }
Example #9
Source File: SampleApplicationLike.java From Bugly-Android-Demo with Apache License 2.0 | 5 votes |
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) @Override public void onBaseContextAttached(Context base) { super.onBaseContextAttached(base); // you must install multiDex whatever tinker is installed! MultiDex.install(base); // TODO: 安装tinker Beta.installTinker(this); }
Example #10
Source File: DoingDailyMainInit.java From DoingDaily with Apache License 2.0 | 5 votes |
private void initBugly() { Beta.autoInit = true; Beta.autoCheckUpgrade = true; Beta.showInterruptedStrategy = true; Beta.initDelay = 8 * 1000; Beta.canShowUpgradeActs.add(MainActivity.class); Beta.smallIconId = R.drawable.ic_notification_logo; Bugly.init(appContext, ConstantValues.BUGLY_ID, BuildConfig.DEBUG); //CrashReport.testJavaCrash(); }
Example #11
Source File: MyApplication.java From HotFixDemo with MIT License | 5 votes |
@Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); // you must install multiDex whatever tinker is installed! MultiDex.install(mContext); // 安装tinker // 此接口仅用于反射Application方式接入。 Beta.installTinker(); }
Example #12
Source File: MyApplication.java From Bugly-Android-Demo with Apache License 2.0 | 5 votes |
@Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); // you must install multiDex whatever tinker is installed! MultiDex.install(base); // 安装tinker Beta.installTinker(); }
Example #13
Source File: SampleApplicationLike.java From HotFixDemo with MIT License | 5 votes |
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) @Override public void onBaseContextAttached(Context base) { super.onBaseContextAttached(base); // you must install multiDex whatever tinker is installed! MultiDex.install(base); // 安装tinker Beta.installTinker(this); }
Example #14
Source File: GravityBoxApplication.java From GravityBox with Apache License 2.0 | 5 votes |
private void initBugly() { Beta.upgradeCheckPeriod = 60 * 1000 * 60 * 12; Beta.initDelay = 1000; Beta.showInterruptedStrategy = true; Beta.enableHotfix = false; Bugly.init(getApplicationContext(), "375cce688e", BuildConfig.DEBUG); }
Example #15
Source File: MainActivity.java From Bugly-Android-Demo with Apache License 2.0 | 5 votes |
private void loadUpgradeInfo() { if (tvUpgradeInfo == null) return; /***** 获取升级信息 *****/ UpgradeInfo upgradeInfo = Beta.getUpgradeInfo(); if (upgradeInfo == null) { tvUpgradeInfo.setText("无升级信息"); return; } StringBuilder info = new StringBuilder(); info.append("id: ").append(upgradeInfo.id).append("\n"); info.append("标题: ").append(upgradeInfo.title).append("\n"); info.append("升级说明: ").append(upgradeInfo.newFeature).append("\n"); info.append("versionCode: ").append(upgradeInfo.versionCode).append("\n"); info.append("versionName: ").append(upgradeInfo.versionName).append("\n"); info.append("发布时间: ").append(upgradeInfo.publishTime).append("\n"); info.append("安装包Md5: ").append(upgradeInfo.apkMd5).append("\n"); info.append("安装包下载地址: ").append(upgradeInfo.apkUrl).append("\n"); info.append("安装包大小: ").append(upgradeInfo.fileSize).append("\n"); info.append("弹窗间隔(ms): ").append(upgradeInfo.popInterval).append("\n"); info.append("弹窗次数: ").append(upgradeInfo.popTimes).append("\n"); info.append("发布类型(0:测试 1:正式): ").append(upgradeInfo.publishType).append("\n"); info.append("弹窗类型(1:建议 2:强制 3:手工): ").append(upgradeInfo.upgradeType); tvUpgradeInfo.setText(info); }
Example #16
Source File: AboutActivity.java From OpenHub with GNU General Public License v3.0 | 5 votes |
private void buildApp(MaterialAboutCard.Builder appBuilder, final Context context){ appBuilder.addItem(new MaterialAboutTitleItem.Builder() .text(getString(R.string.app_github_name)) .desc(getString(R.string.app_copyright)) .icon(R.mipmap.logo) .build()); appBuilder.addItem(new MaterialAboutActionItem.Builder() .text(R.string.version) .subText(BuildConfig.VERSION_NAME) .icon(R.drawable.ic_menu_about) .setOnClickAction(new MaterialAboutItemOnClickAction() { @Override public void onClick() { Beta.checkUpgrade(true, true); } }) .build()); appBuilder.addItem(new MaterialAboutActionItem.Builder() .text(R.string.source_code) .subText(R.string.source_code_wishes) .icon(R.drawable.ic_code) .setOnClickAction(new MaterialAboutItemOnClickAction() { @Override public void onClick() { RepositoryActivity.show(context, getString(R.string.author_login_id), getString(R.string.app_github_name)); } }) .build()); }
Example #17
Source File: HHApplication.java From HHComicViewer with Apache License 2.0 | 5 votes |
/** * 初始化腾讯bugly */ private void initBugly() { Beta.largeIconId = R.mipmap.ic_launcher; Beta.smallIconId = R.mipmap.ic_launcher; //设置SD卡中的Download为默认的更新目录 Beta.storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); Bugly.init(getApplicationContext(), "e436df84f4", org.huxizhijian.sdk.util.Utils.isApkDebugable(this)); }
Example #18
Source File: AboutActivity.java From shinny-futures-android with GNU General Public License v3.0 | 5 votes |
@Override protected void initEvent() { findViewById(R.id.check_version).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Beta.checkUpgrade(); } }); }
Example #19
Source File: MyApplication.java From music_player with Open Software License 3.0 | 5 votes |
private void initialBugly() { new Thread(new Runnable() { @Override public void run() { 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)); Beta.initDelay = 3000; Bugly.init(context, "1d65abe1b1", false); } }).start(); }
Example #20
Source File: AndroidPlusApp.java From AndroidPlusJava with GNU General Public License v3.0 | 5 votes |
@Override public void onCreate() { super.onCreate(); //Init Lean Cloud initSubClasses(); AVOSCloud.initialize(this, APP_ID, APP_KEY); AVOSCloud.setDebugLogEnabled(BuildConfig.DEBUG); EventBus.builder().addIndex(new MyEventBusIndex()).installDefaultEventBus(); Beta.enableHotfix = false; Beta.autoDownloadOnWifi = true; Bugly.init(getApplicationContext(), "033d44667d", BuildConfig.DEBUG); }
Example #21
Source File: AcgClubLike.java From AcgClub with MIT License | 5 votes |
@Override public void onBaseContextAttached(Context base) { super.onBaseContextAttached(base); MultiDex.install(base); Beta.installTinker(this); if (mCommonApplicationLike == null) { mCommonApplicationLike = new CommonApplicationLike(TinkerManager.getApplication()); } }
Example #22
Source File: MyApplication.java From Pic2Ascii with MIT License | 5 votes |
@Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); // you must install multiDex whatever tinker is installed! MultiDex.install(base); // 安装tinker Beta.installTinker(); }
Example #23
Source File: SettingActivity.java From JReadHub with GNU General Public License v3.0 | 5 votes |
@Override public void initDataAndEvent() { mUserSystemBrowserItem.setChecked(mPresenter.isUseSystemBrowser()); mUserSystemBrowserItem.setOnCheckedChangedListener(isChecked -> mPresenter.setUseSystemBrowser(isChecked)); mAutoUpdateItem.setChecked(mPresenter.isAutoUpgrade()); mAutoUpdateItem.setOnCheckedChangedListener(isChecked -> Beta.autoCheckUpgrade = isChecked); mThemeDialog.setOnThemeChangeListener(this); }
Example #24
Source File: SettingFragment.java From JReadHub with GNU General Public License v3.0 | 5 votes |
@Override public void initDataAndEvent() { mUserSystemBrowserItem.setChecked(mPresenter.isUseSystemBrowser()); mUserSystemBrowserItem.setOnCheckedChangedListener(isChecked -> mPresenter.setUseSystemBrowser(isChecked)); mAutoUpdateItem.setChecked(mPresenter.isAutoUpgrade()); mAutoUpdateItem.setOnCheckedChangedListener(isChecked -> { Beta.autoCheckUpgrade = isChecked; mPresenter.setAutoCheckUpgrade(isChecked); }); mThemeDialog.setOnThemeChangeListener(this); }
Example #25
Source File: ReadhubApplicationLike.java From JReadHub with GNU General Public License v3.0 | 5 votes |
private void initBugly() { String packageName = getApplication().getPackageName(); String processName = getProcessName(android.os.Process.myPid()); CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(getApplication()); strategy.setUploadProcess(processName == null || processName.equals(packageName)); Beta.storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); Beta.autoCheckUpgrade = false; Beta.canShowUpgradeActs.add(MainActivity.class); String channel = WalleChannelReader.getChannel(getApplication()); strategy.setAppChannel(channel); Bugly.init(getApplication(), "c16799f8bc", false, strategy); }
Example #26
Source File: ReadhubApplicationLike.java From JReadHub with GNU General Public License v3.0 | 5 votes |
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) @Override public void onBaseContextAttached(Context base) { super.onBaseContextAttached(base); // you must install multiDex whatever tinker is installed! MultiDex.install(base); // 安装tinker Beta.installTinker(this); }
Example #27
Source File: AboutFragment.java From guanggoo-android with Apache License 2.0 | 5 votes |
@Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { Element checkUpdateElement = new Element(); checkUpdateElement.setTitle(getString(R.string.check_updates)) .setIconDrawable(R.drawable.ic_update) .setOnClickListener(v -> Beta.checkUpgrade(true, false)); Element qrcodeElement = new Element(); qrcodeElement.setTitle(getString(R.string.feedback)) .setIconDrawable(R.drawable.ic_feedback) .setOnClickListener(v -> mListener.openPage(ConstantUtil.FEEDBACK_URL, getString(R.string.feedback))); Element shareElement = new Element(); shareElement.setTitle(getString(R.string.share_to_friend)) .setIconDrawable(R.drawable.ic_menu_share) .setOnClickListener(v -> { if (getActivity() != null) { ShareUtil.shareLink(getActivity(), ConstantUtil.DOWNLOAD_URL_COOLAPK); } }); Element policyElement = new Element(); policyElement.setTitle(getString(R.string.privacy_and_policy)) .setIconDrawable(R.drawable.ic_policy) .setOnClickListener(v -> startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(ConstantUtil.PRIVACY_URL)))); return new AboutPage(getActivity()) .isRTL(false) .setImage(R.drawable.guanggoo_new) .setDescription(getString(R.string.app_description, VersionUtil.getVersion(getContext()))) .addItem(checkUpdateElement) .addItem(qrcodeElement) .addItem(shareElement) .addItem(policyElement) .addGitHub(getString(R.string.source_code_address), getString(R.string.source_code)) .create(); }
Example #28
Source File: AboutActivity.java From NewFastFrame with Apache License 2.0 | 5 votes |
@Override public void onClick(View v) { int id = v.getId(); if (id == R.id.rl_activity_about_protocol) { ProtocolActivity.start(this); } else if (id == R.id.rl_activity_about_policy) { } else if (id == R.id.rl_activity_about_encourage) { } else if (id == R.id.rl_activity_about_check_up_grade) { Beta.checkUpgrade(); }else if (id==R.id.rl_activity_about_developer_info){ DeveloperInfoActivity.start(this); } }
Example #29
Source File: BaseApplication.java From NewFastFrame with Apache License 2.0 | 5 votes |
@Override public void onClick(View v) { int i = v.getId(); if (i == R.id.tv_view_dialog_common_left) { Beta.cancelDownload(); dialog.dismiss(); } else if (i == R.id.tv_view_dialog_common_right) { DownloadTask downloadTask = Beta.startDownload(); if (downloadTask.getStatus() == DownloadTask.DOWNLOADING) { dialog.dismiss(); } } }
Example #30
Source File: BaseApplication.java From NewFastFrame with Apache License 2.0 | 5 votes |
@Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); applicationDelegate = new ApplicationDelegate(base); applicationDelegate.attachBaseContext(base); MultiDex.install(this); Beta.installTinker(); }