alexliusheng / checkversionlib Goto Github PK
View Code? Open in Web Editor NEW版本检测升级(更新)库。an auto check version library(app update) on Android
Home Page: https://github.com/AlexLiuSheng/CheckVersionLib
版本检测升级(更新)库。an auto check version library(app update) on Android
Home Page: https://github.com/AlexLiuSheng/CheckVersionLib
在DemoService的onResponses方法中调用showVersionDialog出错,出错信息:Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag.
非静默下载中添加了 intent.addFlags(268435456),而静默下载并没有,是这个原因吗?
静默下载,看代码直接调用下载模块,那如果在6.0之后的手机上,在下载之前没有请求SD卡读写权限。导致如果没有权限,会直接回调OnDownLoadFail。显示进度条的下载是做了权限请求的,不会有此问题。所以如果需求是静默下载的话,最好在调用之前,做一下读写权限的检查。
下载apk包安装时出现"解析包时出现问题"的错误.
如果网络不好造成ui卡死,是为啥
弹出更新对话框后,点击“确定”或者“取消”时会有一闪而过的痕迹。。。这应该是退出activity的动画效果,不过也很影响用户体验的,可以优化下么
gradle配置:
compileSdkVersion 23
buildToolsVersion '22.0.1'
minSdkVersion 18
targetSdkVersion 23
引入库之后自动把我的support库更新到24,然后出现NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID
应用直接无法打开。请问有没有什么解决方案?
(在Android5.0的手机上打开没问题)
版本1.5.3 系统MIUI9
操作步骤
1.进入应用发现更新,用户点击更新并下载完成
2.自动跳转到应用安装界面
3.此时用户点击系统安装界面的取消按钮,退出此次安装,能回调到onDownloadSuccess方法完成强制退出
4.用户再次打开应用,应用提示更新,点击更新,由于本地已经下载了安装包,不会重新下载,直接跳转安装界面
5.用户在此时再次点击取消安装,不能回调dialogDismiss或者onDownloadSuccess或者其他方法完成强制退出
此时用户就可以绕过强制更新而使用旧版本,复现率100%
暂时解决办法,setForceRedownload(true)开启强制重新下载
首次更新,下载APK在文件目录,安装完成后未删除该安装包,导致再次版本更新时,不下载新APK.而是直接安装之前老的apk.
解决方法,修改checkAPKIsRight方法,对安装包的包名以及版本进行校验
Doze 模式下不显示下载对话框
但一下层又无法更新
@AlexLiuSheng
VersionDialogActivity 中缺少调起吧
@OverRide
public void onDismiss(DialogInterface dialogInterface) {
}
这里什么都没有,cancelListener都没用到啊。
通知栏显示进度,进度条下方的进度数字:25%/100%能不能把百分号去掉?!或者直接显示:25%
把lib和demo分开为独立的模块,可以让库少用一个 com.alibaba:fastjson:1.2.17
另外建议能用通用的库就用通用的库,把 okhttputils 换成 okhttp3。
可以减少引入本库后增加的体积。
有些细节想和你探讨下,gitHub不方便 可以留个联系方式吗?比如工作的QQ之类的,或者企鹅我:435725233 希望版主看到了 可以回一下哈 谢谢
我有自己的检查更新sdk,怎么只使用你的下载对话框和下载功能呢?
一定要 AllenChecker.startVersionCheck(MainActivity.this, builder.build());么?
Caused by: Android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
如果图标名字一样的话可能会显示机器人
在华为荣耀6,Android 6.0的版本上,根据默认路径(
/storage/emulated/0/AllenVersionPath/)创建下载文件抛异常的.具体在FileCallBack 的60行.默认为app当前私有目录是可以的.
网络框架对https支持吗?5.0以下的手机https可以请求到吗?
下载失败点击通知栏跳转到自定义的activity什么都没有
setRequestUrl和showVersionDialog里面的url有什么区别吗
而不是像demo一样浮动在原来的界面
重写的showVersionDialog()方法,用了
versionDialog.setContentView(R.layout.activity_version_update_dialog);
目前在华为Mate9上测试,通知栏可以弹出消息,但在OPPPO R9,魅族等机型上,通知栏没有消息弹出来,莫非Notification版本不适配?
网络被劫持的时候会下载到其他apk, 可否加入校验提示用户重新下载?
Failure [INSTALL_FAILED_CONFLICTING_PROVIDER: Package couldn't be installed in /data/app/com.zhuan.duoladriver-1: Can't install because provider name com.allenliu.versionchecklib.versionProvider (in package com.zhuan.duoladriver) is already used by com.XXX]
有遇到这样的情况,进度一直是负数,我需要监听是负数的时候,自动取消下载进程,这个如何实现?
我这边项目使用到的OKGO版本是3.0.4 朋友你使用的是OKGO版本是2.1.4 请问两个会冲突吗?
VersionParams.Builder builder = new VersionParams.Builder()
.setRequestUrl("http://www.baidu.com")
.setCustomDownloadActivityClass(CustomDialogActivity.class)
.setService(MyService.class);
Retrofit mRetrofit = new Retrofit.Builder()
.baseUrl(URL)
.addConverterFactory(GsonConverterFactory.create(gson))
.client(okHttpClient)
.build();
问题1:“setRequestUrl("http://www.baidu.com")”的作用相当于Retrofit 中的“baseUrl(URL)”么?
好像除了为空外随便输什么网址都可以啊。
问题2:既然上面已经设置了一个url,但showVersionDialog("downloadUrl","test","test",bundle)中的downloadUrl仍然要求是apk的完整url地址,这样做是为了什么?
@OverRide
public int onStartCommand(Intent intent, int flags, int startId) {
Log.e("onStartCommand", "intent: " + intent);
if (intent != null) {
versionParams = intent.getParcelableExtra(VERSION_PARAMS_KEY);
requestVersionUrlSync();
}
return super.onStartCommand(intent, flags, startId);
}
你可以发现不加判断,崩溃的时候,intent打印出来是null
通知栏显示进度,进度条下方的进度数字:25%/100%能不能把百分号去掉?!或者直接显示:25%
如果能减少对okgo依赖,仅使用okHttp或HttpURLConnection来下载就更好了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.