| | |
| | | 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 com.umeng.commonsdk.UMConfigure; |
| | | //import com.umeng.commonsdk.UMConfigure; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | |
| | | import java.util.Locale; |
| | | import java.util.Objects; |
| | | |
| | | import cn.jpush.android.api.JPushInterface; |
| | | //import cn.jpush.android.api.JPushInterface; |
| | | import io.dcloud.common.util.RuningAcitvityUtil; |
| | | import me.jessyan.autosize.AutoSize; |
| | | import me.jessyan.autosize.AutoSizeConfig; |
| | |
| | | |
| | | public class HDLApp extends Application { |
| | | |
| | | final String TAG=HDLApp.class.getName(); |
| | | final String TAG = HDLApp.class.getName(); |
| | | //控制打印 Debug模式打印 |
| | | private Boolean isLogEnabled = true; |
| | | //三方sdk初始化标识 |
| | |
| | | this.networkMonitoring(); |
| | | //初始化本地assets文件夹资源文件 |
| | | // this.initLocalAssetsData(); |
| | | //初始化友盟SDK |
| | | initUMengSDK(); |
| | | // //初始化友盟SDK,放在StartActivity里面初始化 |
| | | // initUMengSDK(); |
| | | |
| | | |
| | | } |
| | |
| | | * 集成教程地址:https://developer.umeng.com/docs/119267/detail/118588 |
| | | */ |
| | | private void initUMengSDK() { |
| | | UMConfigure.preInit(this, "6801aec0bc47b67d833fd76d", "XenterraSolar"); |
| | | //appkey和channl必须保持和预初始化一致!!! |
| | | //deviceType:设备类型,UMConfigure.DEVICE_TYPE_PHONE为手机、UMConfigure.DEVICE_TYPE_BOX为盒子 |
| | | //pushSecret:Push推送业务的secret |
| | | UMConfigure.init(this, "6801aec0bc47b67d833fd76d", "XenterraSolar", UMConfigure.DEVICE_TYPE_PHONE, ""); |
| | | UMConfigure.setLogEnabled(false);//AppConfigManage.isDebug() |
| | | // UMConfigure.preInit(this, "6801aec0bc47b67d833fd76d", "XenterraSolar"); |
| | | // //appkey和channl必须保持和预初始化一致!!! |
| | | // //deviceType:设备类型,UMConfigure.DEVICE_TYPE_PHONE为手机、UMConfigure.DEVICE_TYPE_BOX为盒子 |
| | | // //pushSecret:Push推送业务的secret |
| | | // UMConfigure.init(this, "6801aec0bc47b67d833fd76d", "XenterraSolar", UMConfigure.DEVICE_TYPE_PHONE, ""); |
| | | // UMConfigure.setLogEnabled(false);//AppConfigManage.isDebug() |
| | | } |
| | | |
| | | |
| | |
| | | @Override |
| | | public void onReLogin(int type) { |
| | | |
| | | |
| | | boolean isLoginActivity = false; |
| | | // 获取当前Activity的列表 |
| | | ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); |
| | | List<ActivityManager.RunningTaskInfo> taskInfo = activityManager.getRunningTasks(1); |
| | | // 遍历Activity列表,判断目标Activity是否在列表中 |
| | | for (ActivityManager.RunningTaskInfo info : taskInfo) { |
| | | if (info.topActivity.getClassName().equals("com.hdl.photovoltaic.ui.LoginActivity")) { |
| | | // 目标Activity存在 |
| | | // 在这里可以进行相应处理 |
| | | isLoginActivity = true; |
| | | break; |
| | | } |
| | | } |
| | | if (!isLoginActivity) { |
| | | |
| | | } |
| | | |
| | | |
| | | HdlLogLogic.print("监听到登录退出---" + type, true); |
| | | //type: 0:正常退出 1:极光推送强制退出 |
| | | //收到登录处理通知,关闭所有页面并打开登录页面 |
| | | AppManagerUtils.getAppManager().finishAllActivity(); |
| | | // HDLSDKSPUtils.clear();//底层自己清空 |
| | | |
| | | //清空住宅id |
| | | UserConfigManage.getInstance().setHomeId(""); |
| | | //重新登陆,默认同意隐私政策 |
| | | UserConfigManage.getInstance().setAcceiptPolicy(false); |
| | | //重新设定一个时间 |
| | |
| | | * 初始化极光SDK |
| | | */ |
| | | private void initJPush() { |
| | | JPushInterface.setDebugMode(true); |
| | | JPushInterface.init(getBaseContext()); |
| | | // JPushInterface.setDebugMode(true); |
| | | // JPushInterface.init(getBaseContext()); |
| | | } |
| | | |
| | | /** |