<>Android 内部更新实践 完美解决各个版本

<>3. 安装新版本的APP

1. 创建工具类文件 InstallUtil.java

文件内容链接 https://blog.csdn.net/bencheng06/article/details/82887948
<https://blog.csdn.net/bencheng06/article/details/82887948>

2. 注册应用安装FileProvider
<!-- 注册应用安装FileProvider --> <provider
android:name="android.support.v4.content.FileProvider"
android:authorities="这里填写自己的包名.FileProvider" android:exported="false"
android:grantUriPermissions="true"> <!-- 元数据 --> <meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" /> </provider>
3. 注册安装权限,忘记注册会报错
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />


4. 在使用的地方调用一下
new InstallUtil((Activity) context, appPath).install();

友情链接
ioDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:637538335
关注微信