mac
2023-12-11 f97ff347cc7d42c6511e3ebb4bfc23b119e1e445
app/src/main/java/com/hdl/photovoltaic/HDLApp.java
@@ -8,6 +8,7 @@
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.IBinder;
import android.text.TextUtils;
import android.util.DisplayMetrics;
@@ -22,6 +23,7 @@
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;
@@ -40,6 +42,7 @@
import okhttp3.logging.HttpLoggingInterceptor;
public class HDLApp extends Application {
    //控制打印 Debug模式打印
    private Boolean isLogEnabled = true;
    //三方sdk初始化标识
@@ -59,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) {
@@ -116,7 +133,6 @@
        initSocket();
        //4.初始化OKHttpLog 是否开启
        setOKHttpLogOpen(isLogEnabled);
    }
@@ -201,9 +217,6 @@
    }
//    /**
//     * 初始化uni app mqtt
//     */
@@ -216,8 +229,6 @@
//            LogUtils.e("测试Mqtt连接服务端失败");
//        }
//    }
}