diff --git a/.gradle/5.6.4/executionHistory/executionHistory.bin b/.gradle/5.6.4/executionHistory/executionHistory.bin
index 976805d..d512a7a 100644
Binary files a/.gradle/5.6.4/executionHistory/executionHistory.bin and b/.gradle/5.6.4/executionHistory/executionHistory.bin differ
diff --git a/.gradle/5.6.4/executionHistory/executionHistory.lock b/.gradle/5.6.4/executionHistory/executionHistory.lock
index 24f4de8..8c9d276 100644
Binary files a/.gradle/5.6.4/executionHistory/executionHistory.lock and b/.gradle/5.6.4/executionHistory/executionHistory.lock differ
diff --git a/.gradle/5.6.4/fileHashes/fileHashes.bin b/.gradle/5.6.4/fileHashes/fileHashes.bin
index 7c7ecc7..cac2a08 100644
Binary files a/.gradle/5.6.4/fileHashes/fileHashes.bin and b/.gradle/5.6.4/fileHashes/fileHashes.bin differ
diff --git a/.gradle/5.6.4/fileHashes/fileHashes.lock b/.gradle/5.6.4/fileHashes/fileHashes.lock
index 223baa8..83d4f52 100644
Binary files a/.gradle/5.6.4/fileHashes/fileHashes.lock and b/.gradle/5.6.4/fileHashes/fileHashes.lock differ
diff --git a/.gradle/5.6.4/fileHashes/resourceHashesCache.bin b/.gradle/5.6.4/fileHashes/resourceHashesCache.bin
index cdea640..a9065bc 100644
Binary files a/.gradle/5.6.4/fileHashes/resourceHashesCache.bin and b/.gradle/5.6.4/fileHashes/resourceHashesCache.bin differ
diff --git a/.gradle/5.6.4/javaCompile/classAnalysis.bin b/.gradle/5.6.4/javaCompile/classAnalysis.bin
index 8a5ed16..79466dd 100644
Binary files a/.gradle/5.6.4/javaCompile/classAnalysis.bin and b/.gradle/5.6.4/javaCompile/classAnalysis.bin differ
diff --git a/.gradle/5.6.4/javaCompile/jarAnalysis.bin b/.gradle/5.6.4/javaCompile/jarAnalysis.bin
index 0efbd77..bbdba0a 100644
Binary files a/.gradle/5.6.4/javaCompile/jarAnalysis.bin and b/.gradle/5.6.4/javaCompile/jarAnalysis.bin differ
diff --git a/.gradle/5.6.4/javaCompile/javaCompile.lock b/.gradle/5.6.4/javaCompile/javaCompile.lock
index abeb043..9ce092f 100644
Binary files a/.gradle/5.6.4/javaCompile/javaCompile.lock and b/.gradle/5.6.4/javaCompile/javaCompile.lock differ
diff --git a/.gradle/5.6.4/javaCompile/taskHistory.bin b/.gradle/5.6.4/javaCompile/taskHistory.bin
index a9f3ef6..207f61a 100644
Binary files a/.gradle/5.6.4/javaCompile/taskHistory.bin and b/.gradle/5.6.4/javaCompile/taskHistory.bin differ
diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock
index d297c0b..ee174bb 100644
Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ
diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin
index 80631de..5145c6f 100644
Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and b/.gradle/buildOutputCleanup/outputFiles.bin differ
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 61a9130..fb7f4a8 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__com_amitshekhar_android_debug_db_base_1_0_6_aar.xml b/.idea/libraries/Gradle__com_amitshekhar_android_debug_db_base_1_0_6_aar.xml
index e726093..9aab57f 100644
--- a/.idea/libraries/Gradle__com_amitshekhar_android_debug_db_base_1_0_6_aar.xml
+++ b/.idea/libraries/Gradle__com_amitshekhar_android_debug_db_base_1_0_6_aar.xml
@@ -25,6 +25,9 @@
+
+
+
diff --git a/.idea/libraries/Gradle__com_facebook_stetho_stetho_1_5_1_aar.xml b/.idea/libraries/Gradle__com_facebook_stetho_stetho_1_5_1_aar.xml
index ad9bf9e..8210167 100644
--- a/.idea/libraries/Gradle__com_facebook_stetho_stetho_1_5_1_aar.xml
+++ b/.idea/libraries/Gradle__com_facebook_stetho_stetho_1_5_1_aar.xml
@@ -9,6 +9,7 @@
+
@@ -35,6 +36,9 @@
+
+
+
diff --git a/.idea/libraries/Gradle__com_github_yuweiguocn_GreenDaoUpgradeHelper_v2_2_1_aar.xml b/.idea/libraries/Gradle__com_github_yuweiguocn_GreenDaoUpgradeHelper_v2_2_1_aar.xml
index 25ed522..fbada33 100644
--- a/.idea/libraries/Gradle__com_github_yuweiguocn_GreenDaoUpgradeHelper_v2_2_1_aar.xml
+++ b/.idea/libraries/Gradle__com_github_yuweiguocn_GreenDaoUpgradeHelper_v2_2_1_aar.xml
@@ -25,6 +25,9 @@
+
+
+
diff --git a/.idea/libraries/Gradle__com_orhanobut_logger_2_2_0_aar.xml b/.idea/libraries/Gradle__com_orhanobut_logger_2_2_0_aar.xml
index 1e904ea..a8ce350 100644
--- a/.idea/libraries/Gradle__com_orhanobut_logger_2_2_0_aar.xml
+++ b/.idea/libraries/Gradle__com_orhanobut_logger_2_2_0_aar.xml
@@ -25,6 +25,9 @@
+
+
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 87da9c4..bc01c18 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/.idea/modules/app/taxiapp-ktl.app.iml b/.idea/modules/app/taxiapp-ktl.app.iml
index 7b306fc..9fc31d2 100644
--- a/.idea/modules/app/taxiapp-ktl.app.iml
+++ b/.idea/modules/app/taxiapp-ktl.app.iml
@@ -31,7 +31,7 @@
-
+
diff --git a/app/build.gradle b/app/build.gradle
index c135b6c..b802971 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -21,8 +21,8 @@ android {
applicationId "net.sysolution.taxiapp"
minSdkVersion 21
targetSdkVersion 29
- versionCode 251
- versionName "3.3.3-beta26.4.0.9-release"
+ versionCode 253
+ versionName "3.3.3-beta26.4.1.2-release"
//alphaxx - 预览版本,不会对外发布,由测试人员测试,会有很多bug
//Betaxx - 公开测试版本,会发给其他工作人员,会有较多版本
@@ -63,6 +63,7 @@ android {
优化定点广告频z繁切换会出现黑屏问题
3.3.3-beta26.4.0.6-release 优化GPS,播放日志,运行时长上报功能
3.3.3-beta26.4.0.7-release 优化GPS上报,每次取250条数据,小于250条时等待8分钟后再次上传
+ 3.3.3-beta26.4.1.2-release 修复收到的GPS卫星数量为0时频繁刷新问题
**/
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -146,6 +147,8 @@ dependencies {
//网络调试数据库
implementation 'com.amitshekhar.android:debug-db:1.0.6'
+ implementation 'com.squareup.retrofit2:retrofit:2.6.1'
+
//logger
implementation 'com.orhanobut:logger:2.2.0'
diff --git a/app/src/main/java/cn/trans88/taxiappkotlin/logic/model/PlayLogger.java b/app/src/main/java/cn/trans88/taxiappkotlin/logic/model/PlayLogger.java
index 74dc8f0..0d4aecc 100644
--- a/app/src/main/java/cn/trans88/taxiappkotlin/logic/model/PlayLogger.java
+++ b/app/src/main/java/cn/trans88/taxiappkotlin/logic/model/PlayLogger.java
@@ -125,4 +125,6 @@ public class PlayLogger implements Serializable {
this.latitude = latitude;
}
+
+
}
diff --git a/app/src/main/java/cn/trans88/taxiappkotlin/logic/network/ConnManger.kt b/app/src/main/java/cn/trans88/taxiappkotlin/logic/network/ConnManger.kt
index 4141bca..8130658 100644
--- a/app/src/main/java/cn/trans88/taxiappkotlin/logic/network/ConnManger.kt
+++ b/app/src/main/java/cn/trans88/taxiappkotlin/logic/network/ConnManger.kt
@@ -17,6 +17,7 @@ import cn.trans88.taxiappkotlin.logic.Repository.taxiApp
import cn.trans88.taxiappkotlin.logic.dao.DaoUtil
import cn.trans88.taxiappkotlin.logic.model.*
import cn.trans88.taxiappkotlin.net.EasyHttpTool
+import cn.trans88.taxiappkotlin.net.OkHttpTool
import cn.trans88.taxiappkotlin.play.RefreshPlayer
import cn.trans88.taxiappkotlin.ui.play.PlayActivity
import cn.trans88.taxiappkotlin.ui.play.isSendedLog
@@ -502,60 +503,6 @@ object ConnManger {
}
}
- /**
- * 发送坐标
- */
- fun sendLocation() {
- taxiApp.gpsTimer?.let {
- it.cancel()
- it.purge()
- }
- synchronized(ConnManger::class.java){
- //edit by yzd @20211201
- //if (Settings.gpsSwitch) {
- if (Configurations.config(TaxiApp.instance()).gpsSwitch()) {
- "gpsSwitch on".loge()
- taxiApp.gpsTimer = Timer()
- taxiApp.gpsTimer?.schedule(object : TimerTask() {
- override fun run() {
- //edit by ljh @2024/2/28
- val locations = DaoUtil.getLocations()
- if (locations.isNotEmpty()) {
-
- val requestJson: String = ProcessingCommands.gson.toJson(locations)
- //edit by ljh @2023/10/12
- for (location in locations) {
- DaoUtil.getLocationDao().delete(location)
- }
- EasyHttpTool.sendGPSToServer(requestJson)
- }
-// sendLocationToWeb()
-// sendLocation()
- }
- }, 5000,10000)
- } else {
- "gpsSwitch off".loge()
- taxiApp.gpsTimer = Timer()
- taxiApp.gpsTimer?.schedule(object : TimerTask() {
- override fun run() {
- //edit by ljh @2024/2/28
- val locations = DaoUtil.getLocations()
- if (locations.isNotEmpty()) {
-
- val requestJson: String = ProcessingCommands.gson.toJson(locations)
- //edit by ljh @2023/10/12
- for (location in locations) {
- DaoUtil.getLocationDao().delete(location)
- }
- EasyHttpTool.sendGPSToServer(requestJson)
- }
-// sendLocationToWeb()
-// sendLocation()
- }
- }, 5000,60 * 60 * 1000)
- }
- }
- }
/**
* 启动发送坐标线程
@@ -575,40 +522,68 @@ object ConnManger {
"提交GPS数据 $requestJson".logd()
val parse = ("application/json;charset=UTF-8").toMediaTypeOrNull()
val body = RequestBody.create(parse, requestJson)
- EasyHttp.post(Configurations.config(TaxiApp.instance()).logServiceUrl() + "postGpsLocationLog")
- .readTimeOut(80*1000) //读超时80s,单位毫秒
- .writeTimeOut(80*1000) //写超时80s,单位毫秒
- .connectTimeout(80*1000) //连接超时80s,单位毫秒
- .headers("Authorization", "Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
- .requestBody(body)
- .retryCount(5) //网络不好自动重试5次
- .retryDelay(600) //本次请求重试延迟时间600ms
- .syncRequest(true)//设置同步请求
- .execute(object : SimpleCallBack(){
- override fun onError(e: ApiException?) {
- "上传GPS数据失败:${e?.message}".loge()
- try {
- Thread.sleep(3*60*1000L)
- }catch (e: Exception) {
- "${e?.message}".loge()
- e.printStackTrace()
- }
- }
+ val url = Configurations.config(TaxiApp.instance()).logServiceUrl() + "postGpsLocationLog"
- override fun onSuccess(t: String?) {
- "上传GPS数据成功 $t".loge()
- DaoUtil.getLocationDao().deleteInTx(upLocations)
- "删除GPS数据成功".logd()
+ try {
+ val request = Request.Builder()
+ .url(url)
+ .addHeader("Authorization", "Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
+ .post(body)
+ .build()
+ val response = OkHttpTool.getInstance().client.newCall(request).execute()
+ "response code:${response?.code}".logd()
+ if (response.isSuccessful){
+ "上传GPS日志成功 ".logd()
+ DaoUtil.getLocationDao().deleteInTx(upLocations)
+ "删除GPS日志成功,upLocations.size:${upLocations.size}".logd()
+
+ if(upLocations.size < 250) {
+ Thread.sleep(8*60*1000L)
}
- })
- if(upLocations.size<250) {
- try {
- Thread.sleep(8*60*1000L)
- } catch (e: Exception) {
- "${e?.message}".loge()
- e.printStackTrace()
+ } else {
+ "上传GPS日志失败".loge()
+ Thread.sleep(3*60*1000L)
}
+ } catch (e: Exception) {
+ "Exception:${e.message}".loge()
+ Thread.sleep(3*60*1000L)
}
+
+// EasyHttp.post(url)
+// .readTimeOut(80*1000) //读超时80s,单位毫秒
+// .writeTimeOut(80*1000) //写超时80s,单位毫秒
+// .connectTimeout(80*1000) //连接超时80s,单位毫秒
+// .headers("Authorization", "Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
+// .requestBody(body)
+// .retryCount(5) //网络不好自动重试5次
+// .retryDelay(600) //本次请求重试延迟时间600ms
+// .syncRequest(true)//设置同步请求
+// .execute(object : SimpleCallBack(){
+// override fun onError(e: ApiException?) {
+// "上传GPS数据失败:${e?.message}".loge()
+// try {
+// Thread.sleep(3*60*1000L)
+// }catch (e: Exception) {
+// "${e?.message}".loge()
+// e.printStackTrace()
+// }
+// }
+//
+// override fun onSuccess(t: String?) {
+// "上传GPS数据成功 $t".loge()
+// DaoUtil.getLocationDao().deleteInTx(upLocations)
+// "删除GPS数据成功".logd()
+// }
+// })
+// if(upLocations.size<250) {
+// try {
+// Thread.sleep(8*60*1000L)
+// } catch (e: Exception) {
+// "${e?.message}".loge()
+// e.printStackTrace()
+// }
+// }
+
} else {
"gps数据小于0条不上传,3分钟后再次查询".logd()
try {
@@ -1076,14 +1051,11 @@ object ConnManger {
val playerLogs = DaoUtil.getPlayLoggers()
"播放日志数据数量:${playerLogs.size}".logd()
if (playerLogs.size>10){
-
EasyHttpTool.sendPlayLogToServer()
-
} else {
-
try {
Thread.sleep(60*1000L)
- }catch (e: Exception){
+ } catch (e: Exception){
"Exception:${e.message}".loge()
e.printStackTrace()
}
@@ -1097,7 +1069,6 @@ object ConnManger {
}
-
/**
* 定时发送播放日志摘要
*/
diff --git a/app/src/main/java/cn/trans88/taxiappkotlin/net/EasyHttpTool.kt b/app/src/main/java/cn/trans88/taxiappkotlin/net/EasyHttpTool.kt
index ce8720c..ab3cbd8 100644
--- a/app/src/main/java/cn/trans88/taxiappkotlin/net/EasyHttpTool.kt
+++ b/app/src/main/java/cn/trans88/taxiappkotlin/net/EasyHttpTool.kt
@@ -18,6 +18,7 @@ import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody
import com.zhouyou.http.callback.SimpleCallBack
import com.zhouyou.http.exception.ApiException
+import okhttp3.Request
import java.util.stream.Collectors
@@ -79,8 +80,8 @@ object EasyHttpTool {
.headers("Authorization", "Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
.headers("Accept-Encoding", "gzip")
.requestBody(body)
- .retryCount(5)//本次请求重试次数
- .retryDelay(600)//本次请求重试延迟时间600ms
+ .retryCount(1)//本次请求重试次数
+ .retryDelay(1000)//本次请求重试延迟时间1000ms
.execute(object :SimpleCallBack(){
override fun onError(e: ApiException?) {
"上传运行时长失败:${e?.message}".loge()
@@ -165,40 +166,67 @@ object EasyHttpTool {
}
/**
- * 上传10条播放日志
+ * 上传100条播放日志
*/
fun sendPlayLogToServer(){
- val tenPlayLogs = DaoUtil.getPlayLogger().queryBuilder().limit(10).build().list()
+ val tenPlayLogs = DaoUtil.getPlayLogger().queryBuilder().limit(100).build().list()
val logJson = ProcessingCommands.gson.toJson(tenPlayLogs)
"提交日志Json $logJson".logd()
val parse = ("application/json;charset=UTF-8").toMediaTypeOrNull()
val body = RequestBody.create(parse, logJson)
- EasyHttp.post(Configurations.config(TaxiApp.instance()).logServiceUrl() + "postPlayerLog")
- .readTimeOut(80*1000)
- .writeTimeOut(80*1000)
- .connectTimeout(80*1000)
- .headers("Authorization", "Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
- .headers("Accept-Encoding", "gzip")
- .requestBody(body)
- .retryCount(5) //本次请求重试次数
- .retryDelay(600) //本次请求重试延迟时间600ms
- .syncRequest(true)//设置同步请求
- .execute(object :SimpleCallBack(){
- override fun onError(e: ApiException?) {
- "上传日志失败:${e?.message}".loge()
- try {
- Thread.sleep(60*1000L)
- }catch (e: Exception){
- "Exception:${e.message}".loge()
- e.printStackTrace()
- }
- }
+ val url = Configurations.config(TaxiApp.instance()).logServiceUrl() + "postPlayerLog"
+
+ try {
+ val request = Request.Builder()
+ .url(url)
+ .addHeader("Authorization","Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
+ .addHeader("Accept-Encoding","gzip")
+ .post(body)
+ .build()
+ val response = OkHttpTool.getInstance().client.newCall(request).execute()
+ "response code:${response?.code}".logd()
+ "response body:${response?.body?.string().toString()}".logd()
+ if (response.isSuccessful){
+ "上传日志成功 ".logd()
+ DaoUtil.getPlayLogger().deleteInTx(tenPlayLogs)
+ "删除日志成功".logd()
+ } else {
+ "上传日志失败".loge()
+ Thread.sleep(60*1000L)
+ }
+ } catch (e: Exception) {
+ "Exception:${e.message}".loge()
+ Thread.sleep(60*1000L)
+ }
+
+
+// EasyHttp.post(url)
+// .readTimeOut(80*1000)
+// .writeTimeOut(80*1000)
+// .connectTimeout(80*1000)
+// .headers("Authorization", "Bearer ${Configurations.config(TaxiApp.instance()).appToken()}")
+// .headers("Accept-Encoding", "gzip")
+// .requestBody(body)
+// .retryCount(5) //本次请求重试次数
+// .retryDelay(600) //本次请求重试延迟时间600ms
+// .syncRequest(true)//设置同步请求
+// .execute(object :SimpleCallBack(){
+// override fun onError(e: ApiException?) {
+// "上传日志失败:${e?.message}".loge()
+// try {
+// Thread.sleep(60*1000L)
+// } catch (e: Exception){
+// "Exception:${e.message}".loge()
+// e.printStackTrace()
+// }
+// }
+//
+// override fun onSuccess(t: String?) {
+// "上传日志成功 $t".loge()
+// DaoUtil.getPlayLogger().deleteInTx(tenPlayLogs)
+// "删除日志成功".loge()
+// }
+// })
- override fun onSuccess(t: String?) {
- "上传日志成功 $t".loge()
- DaoUtil.getPlayLogger().deleteInTx(tenPlayLogs)
- "删除日志成功".loge()
- }
- })
}
}
\ No newline at end of file
diff --git a/app/src/main/java/cn/trans88/taxiappkotlin/net/OkHttpTool.java b/app/src/main/java/cn/trans88/taxiappkotlin/net/OkHttpTool.java
new file mode 100644
index 0000000..6b92a6c
--- /dev/null
+++ b/app/src/main/java/cn/trans88/taxiappkotlin/net/OkHttpTool.java
@@ -0,0 +1,74 @@
+package cn.trans88.taxiappkotlin.net;
+
+import android.util.Log;
+
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.SSLSession;
+
+import okhttp3.Callback;
+import okhttp3.Dns;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.Response;
+
+
+public class OkHttpTool {
+ private OkHttpClient client;
+ private volatile static OkHttpTool instance;
+
+ public static OkHttpTool getInstance() {
+ if (instance == null) {
+ synchronized (OkHttpTool.class) {
+ if (instance == null) {
+ instance = new OkHttpTool();
+ }
+ }
+ }
+ return instance;
+ }
+
+ private OkHttpTool() {
+ client = new OkHttpClient.Builder()
+ .connectTimeout(80, TimeUnit.SECONDS)
+ .readTimeout(80,TimeUnit.SECONDS)
+ .writeTimeout(80,TimeUnit.SECONDS)
+ .build();
+ }
+
+ /**
+ * 发送异步请求
+ * @param url
+ * @param callback
+ */
+ public void sendRequest(String url, Callback callback){
+ Request request = new Request.Builder()
+ .url(url).build();
+ client.newCall(request).enqueue(callback);
+ }
+
+ /**
+ * 发送同步请求
+ * @param url
+ * @return
+ * @throws IOException
+ */
+ public Response sendSyncRequest(String url) throws IOException {
+ Request request = new Request.Builder().url(url).build();
+ return client.newCall(request).execute();
+ }
+
+ public OkHttpClient getClient(){
+ return client;
+ }
+
+}
diff --git a/app/src/main/java/cn/trans88/taxiappkotlin/ui/play/PlayViewModel.kt b/app/src/main/java/cn/trans88/taxiappkotlin/ui/play/PlayViewModel.kt
index 6e456d4..524df94 100644
--- a/app/src/main/java/cn/trans88/taxiappkotlin/ui/play/PlayViewModel.kt
+++ b/app/src/main/java/cn/trans88/taxiappkotlin/ui/play/PlayViewModel.kt
@@ -977,7 +977,7 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
taxiApp.regionsList.clear()
DaoUtil.getRegion().update(region)
}
- }else{
+ } else {
DaoUtil.getRegion().update(region)
}
@@ -1029,13 +1029,17 @@ class PlayViewModel(val lifecycle: Lifecycle, private val fl_play: FrameLayout,
*/
fun clearAreaAdvertise() {
val list = getAdvertise().queryBuilder().where(Properties.BelongTo.eq(AREA.ordinal)).list()
- list?.let {
+ "list对象是空的吗:${list == null}".loge()
+ "list元素是0吗:${list?.size}".loge()
+ //edit by ljh @2024/4/19修复收到的GPS卫星数量为0时频繁刷新问题
+ if (list.isNotEmpty()){
//edit by ljh @2023/8/11
taxiApp.daoAds.clear()
- for (advertise in it) {
+ for (advertise in list) {
getAdvertise().delete(advertise)
}
try {
+ "clearAreaAdvertise -> 刷新列表了".loge()
RefreshPlayer.refresh()
} catch (e: InterruptedException) {
e.printStackTrace()
diff --git a/app/src/main/java/cn/trans88/taxiappkotlin/util/OkHttpTool.java b/app/src/main/java/cn/trans88/taxiappkotlin/util/OkHttpTool.java
new file mode 100644
index 0000000..19309c7
--- /dev/null
+++ b/app/src/main/java/cn/trans88/taxiappkotlin/util/OkHttpTool.java
@@ -0,0 +1,87 @@
+package cn.trans88.taxiappkotlin.util;
+
+import android.util.Log;
+
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.SSLSession;
+
+import okhttp3.Callback;
+import okhttp3.Dns;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.Response;
+
+
+public class OkHttpTool {
+ private OkHttpClient client;
+ private volatile static OkHttpTool instance;
+
+ public static OkHttpTool getInstance() {
+ if (instance == null) {
+ synchronized (OkHttpTool.class) {
+ if (instance == null) {
+ instance = new OkHttpTool();
+ }
+ }
+ }
+ return instance;
+ }
+
+ private OkHttpTool() {
+ client = new OkHttpClient.Builder()
+ .connectTimeout(80, TimeUnit.SECONDS)
+ .readTimeout(80, TimeUnit.SECONDS)
+ .writeTimeout(80, TimeUnit.SECONDS)
+ .build();;
+ }
+
+ /**
+ * 发送异步请求
+ * @param url
+ * @param callback
+ */
+ public void sendRequest(String url, Callback callback){
+ Request request = new Request.Builder().url(url).build();
+ client.newCall(request).enqueue(callback);
+ }
+
+ /**
+ * 发送同步请求
+ * @param url
+ * @return
+ * @throws IOException
+ */
+ public Response sendSyncRequest(String url) throws IOException {
+ Request request = new Request.Builder().url(url).build();
+ return client.newCall(request).execute();
+ }
+
+
+
+ public String getVistor(String url, String token) {
+ Log.i("TAG", "token:" + token);
+ // Headers headers = new Headers.Builder().add("token",token).build();
+ Request request = new Request.Builder().get().url(url + "?dataKey=" + token).build();
+ try {
+ Response response = client.newCall(request).execute();
+ if (response.isSuccessful() && response.code() == 200) {
+ return response.body().string();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+
+}
diff --git a/local.properties b/local.properties
index d288f8f..aad7036 100644
--- a/local.properties
+++ b/local.properties
@@ -4,5 +4,5 @@
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
-#Thu Mar 21 16:48:54 GMT+08:00 2024
+#Thu Apr 18 17:50:04 GMT+08:00 2024
sdk.dir=D\:\\Android\\sdk
diff --git a/release/output.json b/release/output.json
index a4ccdcf..8f70e2c 100644
--- a/release/output.json
+++ b/release/output.json
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":251,"versionName":"3.3.3-beta26.4.0.9-release","enabled":true,"outputFile":"TaxiApp_v3.3.3-beta26.4.0.9-release{251}.apk","fullName":"release","baseName":"release","dirName":""},"path":"TaxiApp_v3.3.3-beta26.4.0.9-release{251}.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":253,"versionName":"3.3.3-beta26.4.1.2-release","enabled":true,"outputFile":"TaxiApp_v3.3.3-beta26.4.1.2-release{253}.apk","fullName":"release","baseName":"release","dirName":""},"path":"TaxiApp_v3.3.3-beta26.4.1.2-release{253}.apk","properties":{}}]
\ No newline at end of file