| | |
| | | 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; |
| | | |
| | | |
| | | import com.hdl.hdlhttp.HxHttpConfig; |
| | |
| | | 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; |
| | | import com.hdl.photovoltaic.utils.LocalManageUtil; |
| | | import com.hdl.photovoltaic.utils.SharedPreUtils; |
| | | import com.hdl.sdk.link.HDLLinkLocalSdk; |
| | | import com.hdl.sdk.link.core.connect.HDLUdpConnect; |
| | | import com.hdl.sdk.link.core.utils.QueueUtils; |
| | | import com.hdl.sdk.link.core.utils.mqtt.MqttRecvClient; |
| | | |
| | | import java.util.HashMap;import java.util.Locale; |
| | | import java.util.HashMap; |
| | | import java.util.Locale; |
| | | import java.util.Objects; |
| | | |
| | | import io.dcloud.common.util.RuningAcitvityUtil; |
| | | import okhttp3.logging.HttpLoggingInterceptor; |
| | | |
| | | public class HDLApp extends Application { |
| | | |
| | | //控制打印 Debug模式打印 |
| | | private Boolean isLogEnabled = true; |
| | | //三方sdk初始化标识 |
| | |
| | | |
| | | 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) { |
| | |
| | | initSocket(); |
| | | //4.初始化OKHttpLog 是否开启 |
| | | setOKHttpLogOpen(isLogEnabled); |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // /** |
| | | // * 初始化uni app mqtt |
| | | // */ |
| | |
| | | // } |
| | | // } |
| | | |
| | | |
| | | } |