| | |
| | | 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 java.util.Locale; |
| | | import java.util.Objects; |
| | | |
| | | import cn.jpush.android.api.JPushInterface; |
| | | import io.dcloud.common.util.RuningAcitvityUtil; |
| | | import okhttp3.logging.HttpLoggingInterceptor; |
| | | |
| | | public class HDLApp extends Application { |
| | | |
| | | /** |
| | | * 默认中文 |
| | | */ |
| | | public String currentAppLanguage = "zh"; |
| | | //控制打印 Debug模式打印 |
| | | private Boolean isLogEnabled = true; |
| | | //三方sdk初始化标识 |
| | |
| | | |
| | | super.onCreate(); |
| | | mHDLApp = this; |
| | | SharedPreUtils.init(this); |
| | | getAppLanguage(); |
| | | initThirdSDK(); |
| | | |
| | | } |
| | | |
| | | public void getAppLanguage() { |
| | | String language = SharedPreUtils.getSharedPreferencesKey("language", this); |
| | | String language = UserConfigManage.getInstance().getCurrentAppLanguage(); |
| | | if (TextUtils.isEmpty(language)) { |
| | | //从内存里面获取不到语言,获取当前系统的; |
| | | String str = getResources().getConfiguration().locale.getCountry(); |
| | | if (str.equals("CN") || str.equals("TW")) { |
| | | language = "zh"; |
| | | UserConfigManage.getInstance().setCurrentAppLanguage(LocalManageUtil.zh); |
| | | } else { |
| | | language = "en"; |
| | | UserConfigManage.getInstance().setCurrentAppLanguage(LocalManageUtil.en); |
| | | } |
| | | } |
| | | currentAppLanguage = language; |
| | | |
| | | } |
| | | |
| | | public void setInfoMap(String key, String value) { |
| | |
| | | // //9.初始化网络工具 |
| | | // NetWorkUtil.init(this); |
| | | // //10.初始化极光推送 |
| | | // initJPush(); |
| | | initJPush(); |
| | | initHDLLinkPMSdk(); |
| | | HDLLinkLocalSdk.getInstance().init(getInstance()); |
| | | initSocket(); |
| | |
| | | } |
| | | } |
| | | |
| | | private void initJPush() { |
| | | JPushInterface.setDebugMode(true); |
| | | JPushInterface.init(getBaseContext()); |
| | | } |
| | | |
| | | |
| | | // /** |
| | | // * 初始化uni app mqtt |