Commit 0c91aee4 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 538254fa
......@@ -12,6 +12,7 @@ import com.downloader.PRDownloaderConfig;
import com.mints.helivideo.ad.TTAdManagerHolder;
import com.mints.helivideo.common.Constant;
import com.mints.helivideo.manager.TXCSDKService;
import com.mints.helivideo.manager.TalkingDataManager;
import com.mints.helivideo.net.LoanService;
import com.mints.helivideo.net.V6Service;
import com.mints.helivideo.utils.AppPreferencesManager;
......@@ -79,6 +80,8 @@ public class MintsApplication extends MultiDexApplication {
TXCSDKService.init(this);
TalkingDataManager.INSTANCE.init(this);
// PR下载附件
initPRDownloader();
......
package com.mints.helivideo.manager
import android.app.Application
import android.content.Context
import com.mints.helivideo.BuildConfig
import com.mints.helivideo.utils.MateUtils
import com.tendcloud.tenddata.TCAgent
/**
* TalkingData
*/
object TalkingDataManager {
private const val APP_KEY =BuildConfig.RELEASE_TALKING_DATA_KEY
fun init(application:Application) {
try {
//打开日志
TCAgent.LOG_ON = BuildConfig.LOG_DEBUG
/**
* 动态获取渠道ID(类似友盟)
* AppID说是xml文件里的密钥?
*/
TCAgent.init(application, APP_KEY
, MateUtils.getAppMetaData(application, "CHANNEL_NAME"))
/**
* true-开启自动捕获错误
*/
TCAgent.setReportUncaughtExceptions(true)
} catch (e: Exception) {
e.printStackTrace()
}
}
fun onResume(cxt:Context,name:String){
TCAgent.onPageStart(cxt, name)
}
fun onPause(cxt:Context,name:String){
TCAgent.onPageEnd(cxt, name)
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment