1.适用范围
Java8
Kotlin:1.3.11
Gradle:3.1.2
Android Studio:3.2
2.集成准备
在配置CC阅读android客户端前,请先申请阿里热修复,友盟统计,新浪,QQ,微信等第三方平台的appkey,广告目前接入的是广点通广告,如需要,申请广点通广告位。如需推送功能,目前支持小米推送及华为推送,请申请相应功能。
阿里热修复? ?https://help.aliyun.com/product/51340.html
友盟统计? ?https://www.umeng.com
新浪微博? ?https://open.weibo.com/
QQ? ?https://connect.qq.com/index.html
微信? ?https://open.weixin.qq.com/
广点通? ?https://e.qq.com/dev/index.html
小米推送? ?https://dev.mi.com/console/appservice/push.html
华为推送? ?https://developer.huawei.com/consumer/cn/service/hms/pushservice.html
支付宝? ?https://open.alipay.com/platform/home.htm
阿里短信 https://help.aliyun.com/product/44282.html
微信支付? ?https://pay.weixin.qq.com/index.php/core/home/login?return_url=%2F
3.配置文件
1.在Android Studio工程中的App模块中的SophixStubApplication文件中配置阿里热修复的相关信息:
@Overrideprotected void attachBaseContext(Context base) [super.attachBaseContext(base);// 如果需要使用MultiDex,需要在此处调用。MultiDex.install(this);initSophix();]private void initSophix() [String appVersion = "0.0.0";try [appVersion = this.getPackageManager().getPackageInfo(this.getPackageName(), 0).versionName;] catch (Exception e) []final SophixManager instance = SophixManager.getInstance();instance.setContext(this).setAppVersion(appVersion).setSecretMetaData("appkey", "appsecret", "appsecretToken").setEnableDebug(true).setEnableFullLog().setPatchLoadStatusStub(new PatchLoadStatusListener() [@Overridepublic void onLoad(final int mode, final int code, final String info, final int handlePatchVersion) [if (code == PatchStatus.CODE_LOAD_SUCCESS) [Log.i(TAG, "sophix load patch success!");] else if (code == PatchStatus.CODE_LOAD_RELAUNCH) [// 如果需要在后台重启,建议此处用SharePreference保存状态。Log版权声明
本文仅代表作者观点,不代表xx立场。
本文系作者授权xx发表,未经许可,不得转载。
发表评论:
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。