Commit 05429981 authored by mengcuiguang's avatar mengcuiguang

Merge branch 'dev_huanleduanju_0815' of...

Merge branch 'dev_huanleduanju_0815' of http://gitlab.mints-id.com/android/android_vedio into dev_huanleduanju_0815
parents cc0395ba 0bd9bdea
package com.duben.happyplaylet.manager
import android.app.Application
import android.content.Context
import com.duben.happyplaylet.BuildConfig
import com.duben.happyplaylet.utils.MateUtils
import com.umeng.analytics.MobclickAgent
import com.umeng.commonsdk.UMConfigure
object UmengManager {
private val TAG = UmengManager::class.java.simpleName
fun preInit(application: Application, channel: String) {
UMConfigure.preInit(
application,
MateUtils.getAppMetaData(application, "UMENG_KEY"),
channel
)
}
/**
* 友盟初始化
*/
fun initUm(application: Application, channel: String) {
try {
/*
* 参数4:设备类型,必须参数,传参数为UMConfigure.DEVICE_TYPE_PHONE则表示手机;传参数为UMConfigure.DEVICE_TYPE_BOX则表示盒子;默认为手机。
* 参数5:Push推送业务的secret,需要集成Push功能时必须传入Push的secret,否则传空。
*/
UMConfigure.init(
application,
MateUtils.getAppMetaData(application, "UMENG_KEY"),
channel,
UMConfigure.DEVICE_TYPE_PHONE,
""
)
UMConfigure.setLogEnabled(BuildConfig.DEBUG)
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.LEGACY_MANUAL)
} catch (e: java.lang.Exception) {
e.printStackTrace()
}
}
fun onResume(context: Context) {
MobclickAgent.onResume(context)
}
fun onPause(context: Context) {
MobclickAgent.onPause(context)
}
}
\ 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