本文整理汇总了Java中com.tencent.bugly.beta.Beta类的典型用法代码示例。如果您正苦于以下问题:Java Beta类的具体用法?Java Beta怎么用?Java Beta使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Beta类属于com.tencent.bugly.beta包,在下文中一共展示了Beta类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.tencent.bugly.beta.Beta; //导入依赖的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: initBugly
import com.tencent.bugly.beta.Beta; //导入依赖的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);
}
示例3: onClick
import com.tencent.bugly.beta.Beta; //导入依赖的package包/类
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.maina_start_service:
Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
startActivity(intent);
break;
case R.id.maina_update:
Beta.checkUpgrade();
break;
case R.id.maina_share:
ShareUtil.shareLink("http://holoscan.moyansz.com/luoxiang/download.html" , "分享红包辅助" , "微信全自动抢红包助手(注:如果下载连接中有.1后缀,请手动去掉):" , this);
break;
default:
break;
}
}
示例4: onCreate
import com.tencent.bugly.beta.Beta; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// init upgrade
Beta.init(getApplicationContext(),false);
if (null != navigationView) {
setupDrawerContent(navigationView);
//default
navigationView.setCheckedItem(R.id.menu_users);
View headerView = navigationView.getHeaderView(0);
mAvatarView = ButterKnife.findById(headerView, R.id.id_drawer_header_avatar);
mNameView = ButterKnife.findById(headerView, R.id.id_drawer_header_name);
mEmailView = ButterKnife.findById(headerView, R.id.id_drawer_header_email);
mAvatarView.setOnClickListener(this);
mNameView.setOnClickListener(this);
}
mainPresenter.checkUserStatus();
selectFragment(R.id.menu_users);
}
示例5: onCreateView
import com.tencent.bugly.beta.Beta; //导入依赖的package包/类
@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(new View.OnClickListener() {
@Override
public void onClick(View v) {
Beta.checkUpgrade(true, false);
}
});
return new AboutPage(getActivity())
.isRTL(false)
.setImage(R.drawable.guanggoo_new)
.setDescription(getString(R.string.app_description, VersionUtil.getVersion(getContext())))
.addWebsite(getString(R.string.issue_address), getString(R.string.feedback))
.addItem(checkUpdateElement)
.addGitHub(getString(R.string.source_code_address), getString(R.string.source_code))
.addGroup(getString(R.string.contact_me))
.addEmail(getString(R.string.author_email), getString(R.string.author_email))
.addWebsite(getString(R.string.author_website), getString(R.string.author_website))
.addGitHub(getString(R.string.author_github), getString(R.string.follow_github))
.create();
}
示例6: attachBaseContext
import com.tencent.bugly.beta.Beta; //导入依赖的package包/类
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
//初始化多dex配置
MultiDex.install(this);
Beta.installTinker();
}
示例7: performInit
import com.tencent.bugly.beta.Beta; //导入依赖的package包/类
private void performInit(){
//注册融云小米push
RongPushClient.registerMiPush(getApplicationContext(), Constants.XIAOMI_APPID, Constants.XIAOMI_APPKEY);
//初始化融云
RongIM.init(getApplicationContext());
//设置支持消息回执的会话类型
Conversation.ConversationType[] types = new Conversation.ConversationType[]{
Conversation.ConversationType.PRIVATE,
Conversation.ConversationType.GROUP,
Conversation.ConversationType.DISCUSSION
};
RongIM.getInstance().setReadReceiptConversationTypeList(types);
try {
StatService.startStatService(getApplicationContext(), Constants.MAT_APPKEY, StatConstants.VERSION);
//开启Java Crash异常捕获
StatCrashReporter.getStatCrashReporter(getApplicationContext()).setJavaCrashHandlerStatus(true);
//开启Native异常捕获
// StatCrashReporter.getStatCrashReporter(getApplicationContext()).setJniNativeCrashStatus(true);
} catch (MtaSDkException e) {
e.printStackTrace();
}
//只在MainActivity上显示升级对话框
Beta.canShowUpgradeActs.add(MainActivity.class);
//初始化腾讯Bugly
Bugly.init(getApplicationContext(), Constants.BUGLY_APPID, BuildConfig.LOG_DEBUG);
}
示例8: clicks
import com.tencent.bugly.beta.Beta; //导入依赖的package包/类
@OnClick({R.id.rl_theme, R.id.rl_update, R.id.rl_cache, R.id.rl_check, R.id.switch_theme, R.id.switch_update})
void clicks(View view) {
switch (view.getId()) {
case R.id.rl_theme:
mThemeSwitch.setChecked(!mThemeSwitch.isChecked());
changeSkin();
break;
case R.id.rl_update:
mUpdateSwitch.setChecked(!mUpdateSwitch.isChecked());
AppUtils.getInstance().setUpdateConfig(this, mUpdateSwitch.isChecked());
break;
case R.id.rl_cache:
DataCleanManager.cleanCache(this);
updateCacheTextView();
Toast.makeText(this, "缓存清理成功", Toast.LENGTH_SHORT).show();
break;
case R.id.rl_check:
Beta.checkUpgrade(true, false);
break;
case R.id.switch_theme:
changeSkin();
break;
case R.id.switch_update:
AppUtils.getInstance().setUpdateConfig(this, mUpdateSwitch.isChecked());
break;
default:
break;
}
}
示例9: buildApp
import com.tencent.bugly.beta.Beta; //导入依赖的package包/类
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());
}
示例10: initBugly
import com.tencent.bugly.beta.Beta; //导入依赖的package包/类
private void initBugly() {
Beta.upgradeCheckPeriod = 60 * 1000 * 60 * 12;
Beta.initDelay = 1000;
Beta.showInterruptedStrategy = true;
Beta.enableHotfix = false;
Bugly.init(getApplicationContext(), "375cce688e", BuildConfig.DEBUG);
}
示例11: attachBaseContext
import com.tencent.bugly.beta.Beta; //导入依赖的package包/类
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(base);
Beta.installTinker();
}
示例12: onBaseContextAttached
import com.tencent.bugly.beta.Beta; //导入依赖的package包/类
@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);
}
示例13: attachBaseContext
import com.tencent.bugly.beta.Beta; //导入依赖的package包/类
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
// you must install multiDex whatever tinker is installed!
MultiDex.install(mContext);
// 安装tinker
// 此接口仅用于反射Application方式接入。
Beta.installTinker();
}
示例14: doBusiness
import com.tencent.bugly.beta.Beta; //导入依赖的package包/类
@Override
protected void doBusiness() {
BottomNavigationViewHelper.disableShiftMode(navigationView);
viewpager.setAdapter(new TabAdapter(getSupportFragmentManager(), getFragments()));
viewpager.setOffscreenPageLimit(3);
navigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.tab_main:
viewpager.setCurrentItem(0);
break;
case R.id.tab_data:
viewpager.setCurrentItem(1);
break;
case R.id.tab_video:
viewpager.setCurrentItem(2);
break;
case R.id.tab_more:
viewpager.setCurrentItem(3);
break;
}
return true;
}
});
Beta.checkUpgrade(false, true);
mainPresenter = new MainPresenter(this, this);
mainPresenter.clipboard();
//启动数据更新服务
Intent intent = new Intent(this, UpdateDataService.class);
startService(intent);
}
示例15: onCreate
import com.tencent.bugly.beta.Beta; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
AppContext = getApplicationContext();
application = this;
if (!LeakCanary.isInAnalyzerProcess(this)) {
LeakCanary.install(this);
}
Bmob.initialize(this, Constants.BMOB_APPKEY);
try {
StatConfig.init(this);
User currentUser = BmobUser.getCurrentUser(User.class);
if (currentUser != null) {
StatConfig.setCustomUserId(this, currentUser.getUsername());
}
StatService.startStatService(this, Constants.MAT_APPKEY, StatConstants.VERSION);
//开启Java Crash异常捕获
StatCrashReporter.getStatCrashReporter(this).setJavaCrashHandlerStatus(true);
//开启Native异常捕获
// StatCrashReporter.getStatCrashReporter(getApplicationContext()).setJniNativeCrashStatus(true);
} catch (MtaSDkException e) {
e.printStackTrace();
}
//只在MainActivity上显示升级对话框
Beta.canShowUpgradeActs.add(MainActivity.class);
//初始化腾讯Bugly
Bugly.init(this, Constants.BUGLY_APPID, BuildConfig.LOG_DEBUG);
Bugly.setIsDevelopmentDevice(this, BuildConfig.LOG_DEBUG);
}