| | |
| | | |
| | | public class HDLApp extends Application { |
| | | |
| | | /** |
| | | * 添加标志位控制首次加载逻辑 |
| | | */ |
| | | public boolean isFirstLoad = true; |
| | | final String TAG = HDLApp.class.getName(); |
| | | //控制打印 Debug模式打印 |
| | | private Boolean isLogEnabled = true; |
| | |
| | | @Override |
| | | public void onCreate() { |
| | | super.onCreate(); |
| | | |
| | | // Log.d("Application==onCreate", "onCreate"); |
| | | // // 获取当前进程的PID |
| | | // String processMessage = "进程Uid:" + Process.myUid() + "进程ID:" + Process.myPid() + " 进程名:" + RuningAcitvityUtil.getAppName(getBaseContext()); |
| | | Log.d("Application==onCreate", "onCreate"); |
| | | // Log.d(TAG, processMessage); |
| | | // Log.d("Application==onCreate", processMessage); |
| | | // if (RuningAcitvityUtil.getAppName(getBaseContext()).contains(":")) { |
| | | // //非原生进程,用初始化后面的 |
| | | // return; |
| | | // } |
| | | mHDLApp = this; |
| | | SharedPreUtils.init(this); |
| | | getAppLanguage(); |
| | | //预创建脚本json文件夹 |
| | | HdlFileLogic.getInstance().createHdlDeviceModelLocalJsonDirectory(); |
| | | init(); |
| | | |
| | | |
| | |
| | | return; |
| | | } |
| | | isInitThirdSDK = true; |
| | | SharedPreUtils.init(this); |
| | | getAppLanguage(); |
| | | //预创建脚本json文件夹 |
| | | HdlFileLogic.getInstance().createHdlDeviceModelLocalJsonDirectory(); |
| | | UserConfigManage.getInstance().setTouristModeJumpLogic(UserConfigManage.getInstance().isTourist_mode()); |
| | | // //5.初始化Bugly |
| | | // CrashReport.initCrashReport(this, Constant.BUGLY_APP_ID, true); |
| | | //6.初始化DCUniMPSDK |
| | |
| | | initAutoSize(); |
| | | // //初始化极光推送 |
| | | // initJPush(); |
| | | //谷歌原生fcm推送 |
| | | // //谷歌原生fcm推送 |
| | | // // 检查 Google Play Services 后再初始化 FCM |
| | | // if (isGooglePlayServicesAvailable(this)) { |
| | | // initFCM(); |
| | |
| | | // HdlLogLogic.print("Google Play Services 不可用,无法使用 FCM", true); |
| | | // // 可以在这里初始化备选推送方案(如阿里云自建通道) |
| | | // } |
| | | // //阿里云推送 |
| | | //阿里云推送 |
| | | initAliYunPush(); |
| | | initHDLLinkPMSdk(); |
| | | HDLLinkLocalSdk.getInstance().init(getInstance()); |
| | |
| | | HDLLinkPMUser.getInstance().setOnReloginListener(new IOnReloginListener() { |
| | | @Override |
| | | public void onReLogin(int type) { |
| | | // UserConfigManage.getInstance().setTourist_mode(false); |
| | | // UserConfigManage.getInstance().Save(); |
| | | if (type == LogoutType.ServerSwitchingLogout.getValue()) { |
| | | new Handler().postDelayed(new Runnable() { |
| | | @Override |