| | |
| | | package safeluck.drive.evaluation; |
| | | |
| | | import android.app.Application; |
| | | import android.text.TextUtils; |
| | | import android.widget.Toast; |
| | | |
| | | |
| | |
| | | import com.anyun.exam.lib.crash.CrashHandler; |
| | | import com.facebook.stetho.Stetho; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.JsonArray; |
| | | import com.google.gson.JsonObject; |
| | | import com.google.gson.JsonParser; |
| | | |
| | | |
| | | import org.json.JSONException; |
| | |
| | | Stetho.initializeWithDefaults(this); |
| | | |
| | | |
| | | //RTK配置信息 |
| | | // rtkConfig = new RTKConfig(); |
| | | // rtkConfig.setCity(12); |
| | | // rtkConfig.setImei("460123874561"); |
| | | // rtkConfig.setInterval(1); |
| | | // rtkConfig.setIp("47.93.80.84"); |
| | | // rtkConfig.setModel("123"); |
| | | // rtkConfig.setPhone("2019101500000001"); |
| | | // rtkConfig.setPort(12125); |
| | | // rtkConfig.setProvince(23); |
| | | // rtkConfig.setSn("2019101500000001"); |
| | | |
| | | //数据库操作 |
| | | MyLog.i(TAG, "onCreate111"); |
| | | failedProjRepository = new FailedProjRepository(this); |
| | |
| | | MyLog.d(TAG, String.format("收到命令[%d],Json内容为%s", cmd, json)); |
| | | switch (cmd) { |
| | | case Constant.NDK_START: |
| | | Toast.makeText(this, "NDK start", Toast.LENGTH_SHORT).show(); |
| | | |
| | | break; |
| | | case Constant.RTK_PLATFORM_REGISTER_STATUS: |
| | | |
| | |
| | | break; |
| | | case Constant.RTK_PLATFORM_REGISTER_RESULT: |
| | | |
| | | failedProjRepository.insert(new FailedProj(Constant.SUBJECT_I, cmd + random.nextInt(26), Constant.TEST_STU_ID)); |
| | | |
| | | try { |
| | | JSONObject jsonObject = new JSONObject(json); |
| | |
| | | break; |
| | | case Constant.JUDGE_INFO: |
| | | |
| | | if(!TextUtils.isEmpty(json)){ |
| | | JsonArray jsonArray = JsonParser.parseString(json).getAsJsonArray(); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JsonObject jsonObject = jsonArray.get(i).getAsJsonObject(); |
| | | int emp_id = jsonObject.get("wrong_id").getAsInt(); |
| | | |
| | | failedProjRepository.insert(new FailedProj(Constant.SUBJECT_I, cmd, Constant.TEST_STU_ID)); |
| | | failedProjRepository.insert(new FailedProj(Constant.SUBJECT_I, emp_id, Constant.TEST_STU_ID)); |
| | | } |
| | | } |
| | | |
| | | break; |
| | | case Constant.EXAM_STATUS_REPLY: |