| | |
| | | import safeluck.drive.evaluation.DB.rtktb.RTKConfigViewModel; |
| | | import safeluck.drive.evaluation.DB.signalConfigdb.SignalConfigViewModel; |
| | | import safeluck.drive.evaluation.DB.signalConfigdb.SingalConfig; |
| | | import safeluck.drive.evaluation.bean.ExamPlatformData; |
| | | import safeluck.drive.evaluation.bean.SignalConfigRemote; |
| | | import safeluck.drive.evaluation.cEventCenter.CEventCenter; |
| | | import safeluck.drive.evaluation.cEventCenter.ICEventListener; |
| | |
| | | import safeluck.drive.evaluation.util.FileUtil; |
| | | import safeluck.drive.evaluation.util.PermissionManager; |
| | | import safeluck.drive.evaluation.util.SPUtils; |
| | | import safeluck.drive.evaluation.viewmodels.ExamPlatformModel; |
| | | import safeluck.drive.evaluation.viewmodels.MainViewModel; |
| | | import safeluck.drive.evaluation.viewmodels.RTKConnAndLogin; |
| | | import safeluck.drive.evaluation.viewmodels.RTKConnAndLoginViewModel; |
| | |
| | | setContentView(R.layout.activity_main); |
| | | // TODO |
| | | // 进行tcp连接 |
| | | String userId = "100002"; |
| | | String token = "token_" + userId; |
| | | String hosts = "[{\"host\":\"192.168.31.77\", \"port\":12125}]"; |
| | | IMSClientBootstrap.getInstance().init(userId,token,hosts,1,this); |
| | | final String userId = "100002"; |
| | | final String token = "token_" + userId; |
| | | ExamPlatformModel examPlatformModel = ViewModelProviders.of(this).get(ExamPlatformModel.class); |
| | | examPlatformModel.getDataChange().observe(this, new Observer<Integer>() { |
| | | @Override |
| | | public void onChanged(Integer integer) { |
| | | Log.i(TAG, "ExamPlatformModel onChanged: integer=="+integer); |
| | | if (integer == 1){ |
| | | MyLog.i("重新连接考试平台"); |
| | | }else{ |
| | | |
| | | } |
| | | |
| | | |
| | | String str = ExamPlatformData.getInstance().getPlatformIP(); |
| | | String hosts = "[{\"host\":"+str+","+ "\"port\":"+ExamPlatformData.getInstance().getPlatformPort()+"}]"; |
| | | MyLog.i("hosts="+hosts); |
| | | IMSClientBootstrap.getInstance().init(userId,token,hosts,1,MainActivity.this); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |