目录
1.2、FileProvider(主要防止和其他需要FileProvider起的冲突):
二、热更新(需要引入multiDex,见上面的gradle引入,此外热更新不能直接AS安装):
腾讯Bugly简单使用简述
一、全量更新:
1.1、清单文件:
<!-- 必须配置 fileProvider, 注意: android:authorities="${applicationId}.fileProvider" 不要直接copy,设置为你的包名.fileProvider-->
<provider
android:name=".utils.BuglyFileProvider"
android:authorities="com.zbv.testbugly.fileProvider"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="name,authorities,exported,grantUriPermissions">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"
tools:replace="name,resource" />
</provider>
<activity
android:name="com.tencent.bugly.beta.ui.BetaActivity"
android:configChanges="keyboardHidden|orientation|screenSize|locale"
android:theme="@android:style/Theme.Translucent" />
<!--res/xml下的文件-->
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<!-- /storage/emulated/0/Download/${applicationId}/.beta/apk-->
<external-path name="beta_external_path" path="Download/"/>
<!--/storage/emulated/0/Android/data/${applicationId}/files/apk/-->
<external-path name="beta_external_files_path" path="Android/data/"/>
</paths>
1.2、FileProvider(主要防止和其他需要FileProvider起的冲突):
package com.zbv.testbugly.utils
import android.support.v4.content.FileProvider
/**
* author: qzx
* Date: 2019/4/3 10:08
*/
class BuglyFileProvider : FileProvider() {
}
1.3、application(初始化):
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
//Tag同自定义UI
// Beta.upgradeDialogLayoutId = R.layout.upgrade_dialog;
// Beta.tipsDialogLayoutId = R.layout.tips_dialog;
//是否自动初始化升级模块 默认true 如果设置为false的话,后面需要手动调用Beta.init(getApplicationContext(),false);
Beta.autoInit = false
//是否自动检测升级 默认true 如果设置false 后续需要手动调佣Beta.checkUpgrade()
Beta.autoCheckUpgrade = false
//是否启动热更新 默认是true
Beta.enableHotfix = false
//是否显示更新弹框中关于本次更新apk的包信息 默认true
Beta.canShowApkInfo = true
//wifi下自动更新 默认为false
Beta.au