腾讯Bugly简单使用简述

目录

腾讯Bugly简单使用简述

一、全量更新:

1.2、FileProvider(主要防止和其他需要FileProvider起的冲突):

1.3、application(初始化):

1.4、gradle:

二、热更新(需要引入multiDex,见上面的gradle引入,此外热更新不能直接AS安装):

2.1、application:

2.2、applicationLike:

2.3、核心tinker-support.gradle:

2.4、使用:


腾讯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
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值