本文整理汇总了Java中cn.bmob.v3.update.BmobUpdateAgent.update方法的典型用法代码示例。如果您正苦于以下问题:Java BmobUpdateAgent.update方法的具体用法?Java BmobUpdateAgent.update怎么用?Java BmobUpdateAgent.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.bmob.v3.update.BmobUpdateAgent
的用法示例。
在下文中一共展示了BmobUpdateAgent.update方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import cn.bmob.v3.update.BmobUpdateAgent; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_travelban);
BmobUpdateAgent.initAppVersion(this);
ActivityCollector.addActivity(this);
BmobUpdateAgent.update(this);
BmobUpdateAgent.setUpdateListener(new BmobUpdateListener() {
@Override
public void onUpdateReturned(int updateStatus, UpdateResponse updateInfo) {
}
});
setData();
User userInfo = BmobUser.getCurrentUser(TravelBanActivity.this, User.class);
if (userInfo.getAccount()!=null) {
userName=userInfo.getAccount();
}
mImageProvider = new ImageProvider(this);
initView();
Toast.makeText(TravelBanActivity.this, "欢迎," + userName + "!", Toast.LENGTH_SHORT).show();
}
示例2: onCreate
import cn.bmob.v3.update.BmobUpdateAgent; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
if(PrefUtils.getBoolean(this,ConsUtils.IS_UPDATE,true)){
BmobUpdateAgent.update(this);
}
initView();
initData();
}
示例3: onCreate
import cn.bmob.v3.update.BmobUpdateAgent; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// 自动检测更新
BmobUpdateAgent.setUpdateOnlyWifi(false);
BmobUpdateAgent.update(this);
fragmentManager = getSupportFragmentManager();
initView(); // 初始化界面控件
setChioceItem(0); // 初始化页面加载时显示第一个选项卡
}
示例4: onCreate
import cn.bmob.v3.update.BmobUpdateAgent; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
mContext = getApplicationContext();
initUtil();
initTheme();
//友盟异常捕获
MobclickAgent.setCatchUncaughtExceptions(true);
MobclickAgent.setDebugMode(BuildConfig.DEBUG);
//字体
Util.setFontSize(this);
//友盟分享
UMShareAPI.get(this);
Config.DEBUG = BuildConfig.DEBUG;
//bomb
Bmob.initialize(this, "0c070110fffa9e88a1362643fb9d4d64");
BmobUpdateAgent.setUpdateOnlyWifi(false);
BmobUpdateAgent.update(this);
//禁止默认的页面统计方式
MobclickAgent.openActivityDurationTrack(false);
//异常捕获
CrashHandler crashHandler = CrashHandler.getInstance();
crashHandler.init(this);
//检测内存泄漏
if(!LeakCanary.isInAnalyzerProcess(this)){
LeakCanary.install(this);
}
//AppShortcut
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1)
new DynamicShortcutManager(this).setUpShortcut();
}
示例5: onCreate
import cn.bmob.v3.update.BmobUpdateAgent; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bmob.initialize(this, "980918913b223ca35f0c0f69e8850680");
BmobInstallation.getCurrentInstallation(this).save();
BmobPush.startWork(this, "980918913b223ca35f0c0f69e8850680");
BmobUpdateAgent.initAppVersion(this);
BmobUpdateAgent.setUpdateOnlyWifi(false);
BmobUpdateAgent.update(this);
}
示例6: update
import cn.bmob.v3.update.BmobUpdateAgent; //导入方法依赖的package包/类
/**
* 这个是进行app的版本的升级
*/
private void update() {
//BmobUpdateAgent.setUpdateOnlyWifi(true);
BmobUpdateAgent.setUpdateListener(new BmobUpdateListener() {
@Override
public void onUpdateReturned(int updateStatus, UpdateResponse updateInfo) {
// TODO Auto-generated method stub
if (updateStatus == UpdateStatus.Yes) {//版本有更新
} else if (updateStatus == UpdateStatus.No) {
//Toast.makeText(MainActivity.this, "版本无更新", Toast.LENGTH_SHORT).show();
} else if (updateStatus == UpdateStatus.EmptyField) {//此提示只是提醒开发者关注那些必填项,测试成功后,无需对用户提示
//Toast.makeText(MainActivity.this, "请检查你AppVersion表的必填项,1、target_size(文件大小)是否填写;2、path或者android_url两者必填其中一项。", Toast.LENGTH_SHORT).show();
} else if (updateStatus == UpdateStatus.IGNORED) {
//Toast.makeText(MainActivity.this, "该版本已被忽略更新", Toast.LENGTH_SHORT).show();
} else if (updateStatus == UpdateStatus.ErrorSizeFormat) {
//Toast.makeText(MainActivity.this, "请检查target_size填写的格式,请使用file.length()方法获取apk大小。", Toast.LENGTH_SHORT).show();
} else if (updateStatus == UpdateStatus.TimeOut) {
Toast.makeText(MainActivity.this, "查询出错或查询超时", Toast.LENGTH_SHORT).show();
}
}
});
//发起自动更新
BmobUpdateAgent.update(this);
//设置对对话框按钮的点击事件的监听
BmobUpdateAgent.setDialogListener(new BmobDialogButtonListener() {
@Override
public void onClick(int status) {
// TODO Auto-generated method stub
switch (status) {
case UpdateStatus.Update:
Toast.makeText(MainActivity.this, "立即更新", Toast.LENGTH_SHORT).show();
break;
case UpdateStatus.NotNow:
Toast.makeText(MainActivity.this, "以后再说", Toast.LENGTH_SHORT).show();
break;
case UpdateStatus.Close:
//只有在强制更新状态下才会在更新对话框的右上方出现close按钮,
// 如果用户不点击”立即更新“按钮,这时候开发者可做些操作,比如直接退出应用等
Toast.makeText(MainActivity.this, "对话框关闭按钮", Toast.LENGTH_SHORT).show();
break;
}
}
});
}
示例7: initView
import cn.bmob.v3.update.BmobUpdateAgent; //导入方法依赖的package包/类
@Override
public void initView() {
ActionBarDrawerToggle actionBarDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, mToolbar, R.string.open, R.string.close);
actionBarDrawerToggle.syncState();
mDrawerLayout.addDrawerListener(actionBarDrawerToggle);
//存储gank.io的类型
stringArray = getResources().getStringArray(R.array.typeList);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
mRefreshLayout.setOnRefreshListener(new YRefreshLayout.OnRefreshListener() {
@Override
public void onRefreshing() {
page = 1;
newLoadData(page);
}
@Override
public void onLoading() {
page++;
newLoadData(page);
}
});
mainRecyclAdapter = new MainRecyclAdapter(MainActivity.this);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
mRecycleView.setLayoutManager(linearLayoutManager);
mRecycleView.setHasFixedSize(true);//item固定高度可以提高性能
mRecycleView.setAdapter(mainRecyclAdapter);
// 初始化BmobSDK
Bmob.initialize(this, Contant.BOMB_APPID);
//初始化建表操作,执行一次后,就应该注释掉
// BmobUpdateAgent.initAppVersion(this);
//取消只有在wifi情况下才更新
BmobUpdateAgent.setUpdateOnlyWifi(false);
//默认在wifi下才更新
BmobUpdateAgent.update(this);
}
示例8: initView
import cn.bmob.v3.update.BmobUpdateAgent; //导入方法依赖的package包/类
/**
* 初始化布局控件
*/
public void initView() {
BmobUpdateAgent.setUpdateOnlyWifi(false); //判断是否是wifi网络
BmobUpdateAgent.update(this); //检测是否有更新
MyUser myUser = BmobUser.getCurrentUser(MyUser.class);
// EventBus.getDefault().register(this);
if (myUser != null) {
EventBus.getDefault().post(new LoginEvent(myUser));
Log.d("SplashActivity", "myUser:" + myUser);
}
boolean isLogin = getIntent().getBooleanExtra(Contants.IS_COME_FROM_LOGIN, false);
if (isLogin) { //登录状态
PreferencesUtils.putBoolean(this, Contants.IS_LOGIN, true);
}
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
// mDragLayout = (MyDragLayout) findViewById(R.id.qq_slidding);
mIvLive = (ImageView) findViewById(R.id.img_live);
mFrameLayout = (FrameLayout) findViewById(R.id.container);
mRadioHome = (RadioButton) findViewById(R.id.rbTabHome);
mRadioAdvisory = (RadioButton) findViewById(R.id.rbTabAdvisory);
mRadioLord = (RadioButton) findViewById(R.id.rbTabLord);
mRadioThoughts = (RadioButton) findViewById(R.id.rbTabThoughts);
mRadioLive = (RadioButton) findViewById(R.id.rbTabMall);
mRadioHome.setChecked(true);
initLeftDrawer();
initAnimation();
initFragment();
addFragment();
initRadio();
mIvImg.setOnClickListener(this);
registerMessageReceiver(); // used for receive msg
}