Java Code Examples for com.umeng.analytics.MobclickAgent#setCatchUncaughtExceptions()

The following examples show how to use com.umeng.analytics.MobclickAgent#setCatchUncaughtExceptions() . 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: MrApplication.java    From mr-mantou-android with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();

    MobclickAgent.setDebugMode(BuildConfig.DEBUG);
    MobclickAgent.setCatchUncaughtExceptions(false);

    if (BuildConfig.FIR_ENABLED) {
        FIR.init(this);
    }

    MrSharedState.createInstance();

    AVObject.registerSubclass(Image.class);

    AVOSCloud.initialize(this, BuildConfig.AVOS_APP_ID, BuildConfig.AVOS_APP_KEY);
}
 
Example 2
Source File: MaterializeApplication.java    From materialize with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();

    MobclickAgent.setCatchUncaughtExceptions(false);

    if (BuildConfig.FIR_ENABLED) {
        FIR.init(this);
    }

    MaterializeSharedState.init(this);

    MobclickAgent.setDebugMode(BuildConfig.DEBUG);

    HashMap<String, String> event = new HashMap<>();
    event.put("launcher", MaterializeSharedState.getInstance().getLauncher());
    MobclickAgent.onEvent(this, "launcher", event);
}
 
Example 3
Source File: FlutterUmplusPlugin.java    From flutter_umplus with MIT License 5 votes vote down vote up
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 4
Source File: FlutterUmengAnalyticsPlugin.java    From flutter_umeng_analytics with MIT License 5 votes vote down vote up
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 5
Source File: MyApp.java    From Dota2Helper with Apache License 2.0 5 votes vote down vote up
@Override
    public void onCreate() {
        super.onCreate();
//        LeakCanary.install(this);
        FIR.init(this);
        initYoukuConfiguration();
        initClientId();
        initGreenDao();
        NavUtil.init(this);
        gson = new Gson();
        sContext = getApplicationContext();
        MobclickAgent.setCatchUncaughtExceptions(false);
    }
 
Example 6
Source File: MicroApplication.java    From MicroReader with MIT License 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();

    BugtagsOptions options = new BugtagsOptions.Builder().
            trackingLocation(true).//是否获取位置
            trackingCrashLog(!BuildConfig.DEBUG).//是否收集crash
            trackingConsoleLog(true).//是否收集console log
            trackingUserSteps(true).//是否收集用户操作步骤
            build();
    Bugtags.start("9c1b1a3234ceeb5b9c531177a93b65ec", this, Bugtags.BTGInvocationEventNone, options);
    MobclickAgent.setCatchUncaughtExceptions(false);
    microApplication = this;
}
 
Example 7
Source File: MyApplication.java    From Android-Tech with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    MobclickAgent.setDebugMode(true);
    MobclickAgent.setCatchUncaughtExceptions(true);
    MobclickAgent.openActivityDurationTrack(false);

}