Java Code Examples for com.umeng.analytics.MobclickAgent#setSessionContinueMillis()
The following examples show how to use
com.umeng.analytics.MobclickAgent#setSessionContinueMillis() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FlutterUmplusPlugin.java From flutter_umplus with MIT License | 5 votes |
private void initSetup(MethodCall call, Result result) { String appKey = (String)call.argument("key"); String channel = (String)call.argument("channel"); Boolean logEnable = (Boolean)call.argument("logEnable"); Boolean encrypt = (Boolean)call.argument("encrypt"); Boolean reportCrash = (Boolean)call.argument("reportCrash"); Log.d("UM", "initSetup: " + appKey); // Log.d("UM", "channel: " + getMetadata(activity, "INSTALL_CHANNEL")); UMConfigure.setLogEnabled(logEnable); UMConfigure.init(activity, appKey, channel, UMConfigure.DEVICE_TYPE_PHONE, null); UMConfigure.setEncryptEnabled(encrypt); MobclickAgent.setSessionContinueMillis(30000L); MobclickAgent.setCatchUncaughtExceptions(reportCrash); if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { // 大于等于4.4选用AUTO页面采集模式 MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO); } else { MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.MANUAL); } result.success(true); }
Example 2
Source File: FlutterUmengAnalyticsPlugin.java From flutter_umeng_analytics with MIT License | 5 votes |
public void init(MethodCall call, Result result) { // 设置组件化的Log开关,参数默认为false,如需查看LOG设置为true UMConfigure.setLogEnabled(true); /** * 初始化common库 参数1:上下文,不能为空 参数2:【友盟+】Appkey名称 参数3:【友盟+】Channel名称 * 参数4:设备类型,UMConfigure.DEVICE_TYPE_PHONE为手机、UMConfigure.DEVICE_TYPE_BOX为盒子,默认为手机 * 参数5:Push推送业务的secret */ UMConfigure.init(activity, (String) call.argument("key"), "Umeng", UMConfigure.DEVICE_TYPE_PHONE, null); // 设置日志加密 参数:boolean 默认为false(不加密) UMConfigure.setEncryptEnabled((Boolean) call.argument("encrypt")); double interval = call.argument("interval"); if (call.argument("interval") != null) { // Session间隔时长,单位是毫秒,默认Session间隔时间是30秒,一般情况下不用修改此值 MobclickAgent.setSessionContinueMillis(Double.valueOf(interval).longValue()); } else { // Session间隔时长,单位是毫秒,默认Session间隔时间是30秒,一般情况下不用修改此值 MobclickAgent.setSessionContinueMillis(30000L); } // true表示打开错误统计功能,false表示关闭 默认为打开 MobclickAgent.setCatchUncaughtExceptions((Boolean) call.argument("reportCrash")); // 页面采集的两种模式:AUTO和MANUAL,Android 4.0及以上版本使用AUTO,4.0以下使用MANUAL int results = call.argument("mode"); if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { if (results == 0) { // 大于等于4.4选用AUTO页面采集模式 MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO); } } else if (results == 1) { MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.MANUAL); } result.success(true); }
Example 3
Source File: MobclickAgentProxy.java From android-project-wo2b with Apache License 2.0 | 5 votes |
public static void setSessionContinueMillis(long time) { if (!DEBUG) { MobclickAgent.setSessionContinueMillis(time); } }
Example 4
Source File: RLAnalyticsHelper.java From Roid-Library with Apache License 2.0 | 5 votes |
/** * @param context * @param isDebug */ public static void init(Context context, boolean isDebug) { com.umeng.common.Log.LOG = isDebug; MobclickAgent.setDebugMode(isDebug); MobclickAgent.setAutoLocation(true); MobclickAgent.setSessionContinueMillis(1000); // MobclickAgent.setUpdateOnlyWifi(false); // MobclickAgent.setDefaultReportPolicy(context, // ReportPolicy.BATCH_BY_INTERVAL, 5*1000); MobclickAgent.updateOnlineConfig(context); MobclickAgent.onError(context); }
Example 5
Source File: FlutterUmengAnalyticsPlugin.java From flutter_umeng_analytics with MIT License | 4 votes |
public void loginPageView(MethodCall call, Result result) { MobclickAgent.onProfileSignIn((String) call.argument("id")); // Session间隔时长,单位是毫秒,默认Session间隔时间是30秒,一般情况下不用修改此值 MobclickAgent.setSessionContinueMillis((Long) call.argument("interval")); }