From 2ea20ee815b2b95be3e02f93d2ca178e5b852442 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期五, 15 十二月 2023 14:17:52 +0800
Subject: [PATCH] 2023年12月15日14:17:49
---
app/src/main/java/com/hdl/photovoltaic/HDLApp.java | 32 ++++++++++++++++++++++++++++++--
1 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/HDLApp.java b/app/src/main/java/com/hdl/photovoltaic/HDLApp.java
index 2abcc75..1854535 100644
--- a/app/src/main/java/com/hdl/photovoltaic/HDLApp.java
+++ b/app/src/main/java/com/hdl/photovoltaic/HDLApp.java
@@ -1,10 +1,14 @@
package com.hdl.photovoltaic;
import android.app.Application;
+import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
+import android.content.ServiceConnection;
import android.content.res.Configuration;
import android.content.res.Resources;
+import android.os.IBinder;
+import android.text.TextUtils;
import android.util.DisplayMetrics;
@@ -15,6 +19,11 @@
import com.hdl.linkpm.sdk.utils.HDLSDKSPUtils;
import com.hdl.photovoltaic.config.AppConfigManage;
import com.hdl.photovoltaic.config.UserConfigManage;
+import com.hdl.photovoltaic.internet.HttpServer.MyNanoHttpServer;
+import com.hdl.photovoltaic.internet.HttpServer.MyNanoHttpService;
+import com.hdl.photovoltaic.other.HdlFileLogic;
+import com.hdl.photovoltaic.other.HdlOtaLogic;
+import com.hdl.photovoltaic.other.HdlThreadLogic;
import com.hdl.photovoltaic.ui.HomeLoginActivity;
import com.hdl.photovoltaic.uni.HDLUniMPSDKManager;
import com.hdl.photovoltaic.utils.AppManagerUtils;
@@ -33,6 +42,7 @@
import okhttp3.logging.HttpLoggingInterceptor;
public class HDLApp extends Application {
+
//鎺у埗鎵撳嵃 Debug妯″紡鎵撳嵃
private Boolean isLogEnabled = true;
//涓夋柟sdk鍒濆鍖栨爣璇�
@@ -52,8 +62,22 @@
super.onCreate();
mHDLApp = this;
+ SharedPreUtils.init(this);
+ getAppLanguage();
initThirdSDK();
+ }
+ public void getAppLanguage() {
+ String language = UserConfigManage.getInstance().getCurrentAppLanguage();
+ if (TextUtils.isEmpty(language)) {
+ //浠庡唴瀛橀噷闈㈣幏鍙栦笉鍒拌瑷�,鑾峰彇褰撳墠绯荤粺鐨�;
+ String str = getResources().getConfiguration().locale.getCountry();
+ if (str.equals("CN") || str.equals("TW")) {
+ UserConfigManage.getInstance().setCurrentAppLanguage(LocalManageUtil.zh);
+ } else {
+ UserConfigManage.getInstance().setCurrentAppLanguage(LocalManageUtil.en);
+ }
+ }
}
public void setInfoMap(String key, String value) {
@@ -109,6 +133,7 @@
initSocket();
//4.鍒濆鍖朞KHttpLog 鏄惁寮�鍚�
setOKHttpLogOpen(isLogEnabled);
+
}
@@ -191,6 +216,11 @@
}
}
+ private void initJPush() {
+// JPushInterface.setDebugMode(true);
+// JPushInterface.init(getBaseContext());
+ }
+
// /**
// * 鍒濆鍖杣ni app mqtt
@@ -204,8 +234,6 @@
// LogUtils.e("娴嬭瘯Mqtt杩炴帴鏈嶅姟绔け璐�");
// }
// }
-
-
}
--
Gitblit v1.8.0