美文网首页
Umeng集成

Umeng集成

作者: 简爱WindMan | 来源:发表于2017-07-26 18:33 被阅读8次

官方文档


点击这里

统计分析之点击次数


  • 简单封装便于统一管理:

public class AnalyticsUtil {
private static final String TAG = "AnalyticsUtil";
private static AnalyticsUtil instance = null;
private AnalyticsUtil() {
}
public static AnalyticsUtil getInstance() {
synchronized (AnalyticsUtil.class) {
if (instance == null) {
instance = new AnalyticsUtil();
}
}
return instance;
}
public static void analyticsShopoing(Context context, int type) {
String eventId = "shop";
switch (type) {
case 0:
eventId = "shop_0";
break;
case 1:
eventId = "shop_1";
break;
case 2:
eventId = "shop_2";
break;
case 3:
eventId = "shop_3";
break;
}
// Log.d(TAG, "analyticsShopoing , eventId : " + eventId);
MobclickAgent.onEvent(context, eventId);
}
public static void analyticsEnvent(Context context, String eventId, HashMap<String, String> map) {
MobclickAgent.onEvent(context, eventId, map);
}
}

相关文章

网友评论

      本文标题:Umeng集成

      本文链接:https://www.haomeiwen.com/subject/uppokxtx.html