修改MQTT使用方式
修改bug 修改盲盒布局
This commit is contained in:
@@ -31,6 +31,7 @@ import com.xscm.moduleutil.event.AppLifecycleEvent;
|
||||
import com.xscm.moduleutil.interfaces.AppLifecycleUtil;
|
||||
import com.xscm.moduleutil.listener.MessageListenerSingleton;
|
||||
import com.xscm.moduleutil.rtc.AgoraManager;
|
||||
import com.xscm.moduleutil.service.MqttConnect;
|
||||
import com.xscm.moduleutil.service.MyMqttService;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.utils.UtilConfig;
|
||||
@@ -50,6 +51,7 @@ import com.tencent.bugly.crashreport.CrashReport;
|
||||
import com.tencent.qcloud.tuicore.TUILogin;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUICallback;
|
||||
|
||||
import org.eclipse.paho.client.mqttv3.MqttClient;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
@@ -84,7 +86,7 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
public String playName;
|
||||
private final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1);
|
||||
private ScheduledExecutorService scheduledExecutorServiceRoom = null;
|
||||
|
||||
private MqttConnect mqttConnect=null;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
@@ -110,12 +112,15 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
MessageListenerSingleton.getInstance();
|
||||
CrashReport.initCrashReport(this, "ac3ed4d89f", true);/*bugly初始化*/
|
||||
// // 启动 MQTT 服务
|
||||
Intent mqttServiceIntent = new Intent(this, MyMqttService.class);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
startForegroundService(mqttServiceIntent);
|
||||
} else {
|
||||
startService(mqttServiceIntent);
|
||||
}
|
||||
// Intent mqttServiceIntent = new Intent(this, MyMqttService.class);
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
// startForegroundService(mqttServiceIntent);
|
||||
// } else {
|
||||
// startService(mqttServiceIntent);
|
||||
// }
|
||||
|
||||
mqttConnect=MqttConnect.getInstance(this,"tcp://62.234.12.147","android-"+ MqttClient.generateClientId());
|
||||
mqttConnect.mqttClient();
|
||||
|
||||
// 每次启动应用时重置状态
|
||||
SpUtil.getInstance().setBooleanValue("youth_model_shown", false);
|
||||
|
||||
Reference in New Issue
Block a user