From a88912d08d28159bc464f715704a0d08be6edad8 Mon Sep 17 00:00:00 2001 From: lizhanwei <Dana_Lee1016@126.com> Date: 星期二, 31 三月 2020 13:38:26 +0800 Subject: [PATCH] 系统设置增加路考地图选择 --- app/src/main/java/safeluck/drive/evaluation/app.java | 49 ++++++++++++++++++++++++++++++++++++------------- 1 files changed, 36 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/safeluck/drive/evaluation/app.java b/app/src/main/java/safeluck/drive/evaluation/app.java index c4d2568..01c37fd 100644 --- a/app/src/main/java/safeluck/drive/evaluation/app.java +++ b/app/src/main/java/safeluck/drive/evaluation/app.java @@ -502,6 +502,42 @@ @Override public void run() { final String mapPath = ExamPlatformData.getInstance().getMapPath(); + final String roadmapPath = ExamPlatformData.getInstance().getRoadMapPath(); + + if (!TextUtils.isEmpty(roadmapPath)){ + MyLog.i("璋冪敤鏇存柊RoadMap璺緞鍚庣殑鍦板浘"+roadmapPath); + byte[] fileContent = FileUtil.readFile(roadmapPath); + if (fileContent != null){ + String str = new String(fileContent); + Log.i(TAG, "鏂囦欢鍐呭锛�"+str); + AYSdk.getInstance().sendCmd(Constant.PUSH_ROAD_MAP_INFO,str); + }else{ + MyLog.i(String.format("鏂囦欢:%s涓嶅瓨鍦�",roadmapPath)); + + CThreadPoolExecutor.runOnMainThread(new Runnable() { + @Override + public void run() { + Toast.makeText(getAppContext(), "鏂囦欢锛�"+roadmapPath+"涓嶅瓨鍦�", Toast.LENGTH_SHORT).show(); + } + }); + } + }else{ + StringBuffer buffer; + buffer =FileUtil.readAssetTxtFile(getApplicationContext(),Constant.ROAD_MAP); + if (buffer != null){ + + AYSdk.getInstance().sendCmd(Constant.PUSH_ROAD_MAP_INFO,buffer.toString()); + }else{ + MyLog.d(TAG,String.format("鍦板浘妯″瀷鏈嫹鍏%s]鐩綍涓�", Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+getApplicationContext().getPackageName())); + CThreadPoolExecutor.runOnMainThread(new Runnable() { + @Override + public void run() { + Toast.makeText(getAppContext(), String.format("鍦板浘妯″瀷鏈嫹鍏%s]鐩綍涓�", Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+getApplicationContext().getPackageName()), Toast.LENGTH_SHORT).show(); + } + }); + + } + } if (!TextUtils.isEmpty(mapPath)){ MyLog.i("璋冪敤鏇存柊Map璺緞鍚庣殑鍦板浘"+mapPath); byte[] fileContent = FileUtil.readFile(mapPath); @@ -528,20 +564,7 @@ } }); StringBuffer buffer; - buffer =FileUtil.readAssetTxtFile(getApplicationContext(),Constant.ROAD_MAP); - if (buffer != null){ - AYSdk.getInstance().sendCmd(Constant.PUSH_ROAD_MAP_INFO,buffer.toString()); - }else{ - MyLog.d(TAG,String.format("鍦板浘妯″瀷鏈嫹鍏%s]鐩綍涓�", Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+getApplicationContext().getPackageName())); - CThreadPoolExecutor.runOnMainThread(new Runnable() { - @Override - public void run() { - Toast.makeText(getAppContext(), String.format("鍦板浘妯″瀷鏈嫹鍏%s]鐩綍涓�", Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+getApplicationContext().getPackageName()), Toast.LENGTH_SHORT).show(); - } - }); - - } buffer =FileUtil.readAssetTxtFile(getApplicationContext(),Constant.MAP); if (buffer != null){ -- Gitblit v1.8.0