|
1:第一步注册账户下载SDK
略
2:导入JAR包 如图
3:导入:资源
包括样式表 和布局文件
4:集成代码
- /**
- * 检查版本更新
- */
- protected void checkUpdate(){
- updManager = IFlytekUpdate.getInstance(MainActivity.this);
- updManager.setDebugMode(true);
- updManager.setParameter(UpdateConstants.EXTRA_WIFIONLY, "true");
- // 设置通知栏icon,默认使用SDK默认
- updManager.setParameter(UpdateConstants.EXTRA_NOTI_ICON, "false");
- //对话框提醒
- updManager.setParameter(UpdateConstants.EXTRA_STYLE, UpdateConstants.UPDATE_UI_DIALOG);
- updManager.autoUpdate(MainActivity.this, updateListener);
- updateListener = new IFlytekUpdateListener() {
- @Override
- public void onResult(int errorcode, UpdateInfo result) {
- if(errorcode == UpdateErrorCode.OK && result!= null) {
- if(result.getUpdateType() == UpdateType.NoNeed) {
- return;
- }
- updManager.showUpdateInfo(MainActivity.this, result);
- }
- else
- {
- Toast.makeText(getBaseContext(),"请求更新失败! 错误码:"+errorcode,Toast.LENGTH_LONG).show();
- }
- }
- };
- }
复制代码
5:在讯飞后台 可以上传APK 软件检测到新版本会自动下载安装
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|