C011摇钱树CMS免费开源小说APP系统带后端

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文件中配置阿里热修复的相关信息:

@Override
protected 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() {
@Override
public 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.i(TAG, \\\\\\\\\\\\\\\"sophix preload patch success. restart app to make effect.\\\\\\\\\\\\\\\");
}
}
}).initialize();
}
如不需要此功能,在AndroidManifest.xml中修改application的name为BookStoreApplication,并在BookStoreApplication类的onCreate方法中注释或删除SophixManager.getInstance().queryAndLoadNewPatch()

2.在Android Studio工程中的App模块中的BookStoreApplication文件中,配置友盟相关信息及三方信息,用于三方登录及分享功能:

UMConfigure.init(this, \\\\\\\\\\\\\\\"友盟key\\\\\\\\\\\\\\\",”渠道”, UMConfigure.DEVICE_TYPE_PHONE, \\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\")
setScenarioType(this, MobclickAgent.EScenarioType.E_UM_NORMAL)
/**
* 设置组件化的Log开关
* 参数: boolean 默认为false,如需查看LOG设置为true
*/
UMConfigure.setLogEnabled(BuildConfig.DEBUG_MODE)
PlatformConfig.setWeixin(\\\\\\\\\\\\\\\"appkey\\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\"appsecret\\\\\\\\\\\\\\\")
PlatformConfig.setSinaWeibo(\\\\\\\\\\\\\\\"appkey\\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\"appsecret\\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\"授权回调地址\\\\\\\\\\\\\\\")
PlatformConfig.setQQZone(\\\\\\\\\\\\\\\"appkey\\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\"appsecret\\\\\\\\\\\\\\\")
注意QQ除了在这儿配置外,在AndroidManifest.xml中也需要配置
/**
* 友盟-QQ
*/
<activity
android:name=\\\\\\\\\\\\\\\"com.tencent.tauth.AuthActivity\\\\\\\\\\\\\\\"
android:launchMode=\\\\\\\\\\\\\\\"singleTask\\\\\\\\\\\\\\\"
android:noHistory=\\\\\\\\\\\\\\\"true\\\\\\\\\\\\\\\">
<intent-filter>
<action android:name=\\\\\\\\\\\\\\\"android.intent.action.VIEW\\\\\\\\\\\\\\\" />
<category android:name=\\\\\\\\\\\\\\\"android.intent.category.DEFAULT\\\\\\\\\\\\\\\" />
<category android:name=\\\\\\\\\\\\\\\"android.intent.category.BROWSABLE\\\\\\\\\\\\\\\" />
<data android:scheme=\\\\\\\\\\\\\\\"tencentAPPKEY\\\\\\\\\\\\\\\" />
</intent-filter>
</activity>
在AndroidManifest.xml还需要配置友盟的渠道
/**
* Channel ID用来标识App的推广渠道,作为推送消息时给用户分组的一个维度
*/
<meta-data
android:name=\\\\\\\\\\\\\\\"UMENG_CHANNEL\\\\\\\\\\\\\\\"
android:value=\\\\\\\\\\\\\\\"${CHANNEL_VALUE}\\\\\\\\\\\\\\\" />

3.在Android Studio工程中的App模块中的BookStoreApplication文件中,配置推送相关功能。小米推送:

private fun initMiuiPush() {
if (shouldInit()) {
MiPushClient.registerPush(this, \\\\\\\\\\\\\\\"AppID\\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\"AppKey\\\\\\\\\\\\\\\")
}
// 打开Log
val newLogger = object : LoggerInterface {
override fun setTag(tag: String) {
// ignore
}
override fun log(content: String, t: Throwable) {
Log.d(TAG, content, t)
}
override fun log(content: String) {
Log.d(TAG, content)
}
}
Logger.setLogger(this, newLogger)
}
华为推送主要配置在AndroidManifest.xml中:
/**
* 华为推送
*/
<meta-data
android:name=\\\\\\\\\\\\\\\"com.huawei.hms.client.appid\\\\\\\\\\\\\\\"
android:value=\\\\\\\\\\\\\\\"appid=******\\\\\\\\\\\\\\\" />
<meta-data
android:name=\\\\\\\\\\\\\\\"com.huawei.hms.version\\\\\\\\\\\\\\\"
android:value=\\\\\\\\\\\\\\\"2.6.1.301\\\\\\\\\\\\\\\" />
华为推送接收到的数据为scheme类型,需要自信配置相应参数
/**
* 接入HMSSDK 需要注册的应用下载服务 | Access HMSSDK need to register app download service
*/
<service
android:name=\\\\\\\\\\\\\\\"com.huawei.updatesdk.service.deamon.download.DownloadService\\\\\\\\\\\\\\\"
android:exported=\\\\\\\\\\\\\\\"false\\\\\\\\\\\\\\\" />
<activity android:name=\\\\\\\\\\\\\\\".book_push.HuaWeiReceiverActivity\\\\\\\\\\\\\\\">
<intent-filter>
<action android:name=\\\\\\\\\\\\\\\"android.intent.action.VIEW\\\\\\\\\\\\\\\" />
<category android:name=\\\\\\\\\\\\\\\"android.intent.category.DEFAULT\\\\\\\\\\\\\\\" />
<data
android:host=\\\\\\\\\\\\\\\"自定义域名\\\\\\\\\\\\\\\"
android:path=\\\\\\\\\\\\\\\"/地址\\\\\\\\\\\\\\\"
android:scheme=\\\\\\\\\\\\\\\"customscheme\\\\\\\\\\\\\\\" />
</intent-filter>
</activity>

4.在CommenTag文件中,配置广点通广告:

const val AD_APPKEY = \\\\\\\\\\\\\\\"******\\\\\\\\\\\\\\\"
// 开屏页广告位
const val AD_SPLASH_KEY = \\\\\\\\\\\\\\\"******\\\\\\\\\\\\\\\"
//阅读页底部广告位
const val AD_BANNER_KEY = \\\\\\\\\\\\\\\"******\\\\\\\\\\\\\\\"
//阅读页章节末尾广告位
const val AD_NATIVE_IMAGE = \\\\\\\\\\\\\\\"******\\\\\\\\\\\\\\\"
//首页banner最后一页展示广告位
const val AD_NATIVE_BANNER_IMAGE = \\\\\\\\\\\\\\\"******\\\\\\\\\\\\\\\"

5.配置友盟统计多渠道,在config.gradle中定义渠道名称(示例中为渠道cc1/cc2/cc3/cc4)

channel = [
\\\\\\\\\\\\\\\"cc1\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\'\\\\\\\\\\\\\\\"cc1\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\',
\\\\\\\\\\\\\\\"cc2\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\'\\\\\\\\\\\\\\\"cc2\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\',
\\\\\\\\\\\\\\\"cc3\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\'\\\\\\\\\\\\\\\"cc3\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\',
\\\\\\\\\\\\\\\"cc4\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\'\\\\\\\\\\\\\\\"cc4\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\',
\\\\\\\\\\\\\\\"cc5\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\'\\\\\\\\\\\\\\\"cc5\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\'
]
在app模块中的build.gradle中引用相应渠道同时,在readviewlibrary中的build.gradle中应用相应渠道
productFlavors {
cc1 {
manifestPlaceholders = [CHANNEL_VALUE:channel[\\\\\\\\\\\\\\\"cc1\\\\\\\\\\\\\\\"]]
buildConfigField \\\\\\\\\\\\\\\"String\\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\"DEBUG_CHANNEL\\\\\\\\\\\\\\\", channel[\\\\\\\\\\\\\\\"cc1\\\\\\\\\\\\\\\"]
versionCode rootProject.ext.android_version.ccVersionCode
versionName rootProject.ext.android_version.ccVersionName
}
cc2 {
manifestPlaceholders = [CHANNEL_VALUE: channel[\\\\\\\\\\\\\\\"cc2\\\\\\\\\\\\\\\"]]
buildConfigField \\\\\\\\\\\\\\\"String\\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\"DEBUG_CHANNEL\\\\\\\\\\\\\\\", channel[\\\\\\\\\\\\\\\"cc2\\\\\\\\\\\\\\\"]
versionCode rootProject.ext.android_version.ccVersionCode
versionName rootProject.ext.android_version.ccVersionName
}
cc3 {
manifestPlaceholders = [CHANNEL_VALUE: channel[\\\\\\\\\\\\\\\"cc3\\\\\\\\\\\\\\\"]]
buildConfigField \\\\\\\\\\\\\\\"String\\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\"DEBUG_CHANNEL\\\\\\\\\\\\\\\", channel[\\\\\\\\\\\\\\\"cc3\\\\\\\\\\\\\\\"]
versionCode rootProject.ext.android_version.ccVersionCode
versionName rootProject.ext.android_version.ccVersionName
}
cc4 {
manifestPlaceholders = [CHANNEL_VALUE: channel[\\\\\\\\\\\\\\\"cc4\\\\\\\\\\\\\\\"]]
buildConfigField \\\\\\\\\\\\\\\"String\\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\"DEBUG_CHANNEL\\\\\\\\\\\\\\\", channel[\\\\\\\\\\\\\\\"cc4\\\\\\\\\\\\\\\"]
versionCode rootProject.ext.android_version.ccVersionCode
versionName rootProject.ext.android_version.ccVersionName
}
}
productFlavors {
cc1 {
buildConfigField \\\\\\\\\\\\\\\"String\\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\"DEBUG_CHANNEL\\\\\\\\\\\\\\\", rootProject.ext.channel[\\\\\\\\\\\\\\\"cc1\\\\\\\\\\\\\\\"]
}
cc2 {
buildConfigField \\\\\\\\\\\\\\\"String\\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\"DEBUG_CHANNEL\\\\\\\\\\\\\\\", rootProject.ext.channel[\\\\\\\\\\\\\\\"cc2\\\\\\\\\\\\\\\"]
}
cc3 {
buildConfigField \\\\\\\\\\\\\\\"String\\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\"DEBUG_CHANNEL\\\\\\\\\\\\\\\", rootProject.ext.channel[\\\\\\\\\\\\\\\"cc3\\\\\\\\\\\\\\\"]
}
cc4 {
buildConfigField \\\\\\\\\\\\\\\"String\\\\\\\\\\\\\\\", \\\\\\\\\\\\\\\"DEBUG_CHANNEL\\\\\\\\\\\\\\\", rootProject.ext.channel[\\\\\\\\\\\\\\\"cc4\\\\\\\\\\\\\\\"]
}
}
6.微信支付配置,注意微信登录及微信支付结果回调类WXEntryActivity和WXPayEntryActivity是在包名文件夹下的wxapi中,属于最外层的一级文件夹。

7.关于友盟配置签名文件,在app模块下的build.gradle中配置应用的签名文件

signingConfigs {
debug {
toreFile file(\\\\\\\\\\\\\\\'jks文件地址\\\\\\\\\\\\\\\')
storePassword \\\\\\\\\\\\\\\"*********\\\\\\\\\\\\\\\"
keyAlias \\\\\\\\\\\\\\\"*****\\\\\\\\\\\\\\\"
keyPassword \\\\\\\\\\\\\\\"*********\\\\\\\\\\\\\\\"
}
release {
storeFile file(\\\\\\\\\\\\\\\'jks文件地址\\\\\\\\\\\\\\\')
storePassword \\\\\\\\\\\\\\\"*******\\\\\\\\\\\\\\\"
keyAlias \\\\\\\\\\\\\\\"*****\\\\\\\\\\\\\\\"
keyPassword \\\\\\\\\\\\\\\"**********\\\\\\\\\\\\\\\"
}
}

 

C011摇钱树CMS免费开源小说APP系统带后端插图

免责申明: 本站所提供的源码,视频,模板(主题/插件)等资源收集于网络,仅供学习和交流使用 ,版权归原作者所有,请在下载后24小时之内自觉删除。 若使用商业用途,请购买正版授权,否则产生的一切后果将由下载用户自行承担。下载过程中 如遇链接失效或网站未有的资源可添加客服微信:justincomcn咨询。另有部分资源为网上收集或仿制而来,若这些资源侵犯了您的合法权益,请来信通知我们(Email: 1091490218@qq.com),我们会及时删除,给您带来的不便,我们深表歉意!
源码教程搜藏网_专注精品网站源码下载视频资源的网站_免费商业源码视频资源分享 » C011摇钱树CMS免费开源小说APP系统带后端
关于售后:
(1)、因部分资料含有敏感关键词,百度网盘无法分享链接,请联系客服进行发送;
(2)、所有资料在您未收到之前,都可以联系QQ:1091490218 !
(3)、仅支持原渠道退回,学分退回学分余额,微信支付、支付宝退回至您当初选择的付款方式!
(4)、不用担心不给资料,如果没有及时回复也不用担心,看到了都会发给您的!放心!

发表评论

Hi, 如果你对这款模板有疑问,可以跟我联系哦!

联系作者
享更多特权,请先注册登录
喜欢我嘛?喜欢就按“ctrl+D”收藏我吧!♡