update version

This commit is contained in:
zhongchao
2023-02-20 21:11:53 +08:00
parent b71d00aa66
commit 59cd124c5e
6 changed files with 16 additions and 209 deletions

View File

@@ -66,10 +66,6 @@
android:launchMode="singleTask"
android:screenOrientation="landscape"
android:windowSoftInputMode="stateHidden" />
<activity
android:name=".network.NetworkActivity"
android:label="网络测试"
android:launchMode="singleTask" />
<activity
android:name=".RealTimeActivity"
android:label="实时数据测试"

View File

@@ -12,7 +12,6 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.elegant.log.simplelog.Logger;
import com.mogo.cloud.network.NetworkActivity;
import com.mogo.cloud.passport.IMoGoTokenCallback;
import com.mogo.cloud.passport.MoGoAiCloudClient;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
@@ -69,12 +68,6 @@ public class MainActivity extends AppCompatActivity {
MoGoAiCloudClient.getInstance().refreshToken();
});
btnJumpNetWorkPort = findViewById(R.id.btnJumpNetWorkPort);
btnJumpNetWorkPort.setOnClickListener(v -> {
Intent intent = new Intent(MainActivity.this, NetworkActivity.class);
startActivity(intent);
});
btnJumpRealTime = findViewById(R.id.btnJumpRealTime);
btnJumpRealTime.setOnClickListener(v -> {
Intent intent = new Intent(MainActivity.this, RealTimeActivity.class);

View File

@@ -1,180 +0,0 @@
package com.mogo.cloud.network;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.google.gson.Gson;
import com.mogo.cloud.R;
import java.util.HashMap;
import java.util.Map;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import static com.mogo.cloud.network.NetConstants.GEOFENCE_HOST;
import static com.mogo.cloud.network.NetConstants.REALTIME_LOCATION_HOST;
import androidx.appcompat.app.AppCompatActivity;
/**
* created by wujifei on 2021/1/21 12:26
* describe:
*/
public class NetworkActivity extends AppCompatActivity {
private Button btn;
private TextView tvResult;
private ApiService apiService;
private static final String TAG = "NetworkActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_network);
btn = (Button) findViewById(R.id.btn);
tvResult = (TextView) findViewById(R.id.tv_result);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
tvResult.setText("结果显示");
queryRoadData("ZD802C1938L10797");
// queryHelpSignal("F803EB2046PZD00006");
}
});
}
public void queryRoadData(String sn) {
apiService = RetrofitFactory.INSTANCE.getInstance(GEOFENCE_HOST)
.create(ApiService.class);
if (apiService != null) {
Map<String, Object> map = new HashMap<>();
map.put("sn", sn);
apiService.queryRoadDataOfVehiclesRecommend(map)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseData<V2XRoadDataRes>>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(BaseData<V2XRoadDataRes> value) {
tvResult.setText(formatJson(new Gson().toJson(value)));
System.out.println(formatJson(new Gson().toJson(value)));
}
@Override
public void onError(Throwable e) {
tvResult.setText(e.toString());
System.out.println(e);
}
@Override
public void onComplete() {
}
});
}
}
public void queryHelpSignal(String sn) {
apiService = RetrofitFactory.INSTANCE.getInstance(REALTIME_LOCATION_HOST)
.create(ApiService.class);
if (apiService != null) {
Map<String, Object> map = new HashMap<>();
map.put("sn", sn);
apiService.queryHelpSignal(map)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BaseData<V2XSeekHelpRes>>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(BaseData<V2XSeekHelpRes> value) {
tvResult.setText(formatJson(new Gson().toJson(value)));
System.out.println(formatJson(new Gson().toJson(value)));
}
@Override
public void onError(Throwable e) {
tvResult.setText(e.toString());
System.out.println(e);
}
@Override
public void onComplete() {
}
});
}
}
public static String formatJson(String jsonStr) {
if (null == jsonStr || "".equals(jsonStr))
return "";
StringBuilder sb = new StringBuilder();
char last = '\0';
char current = '\0';
int indent = 0;
boolean isInQuotationMarks = false;
for (int i = 0; i < jsonStr.length(); i++) {
last = current;
current = jsonStr.charAt(i);
switch (current) {
case '"':
if (last != '\\') {
isInQuotationMarks = !isInQuotationMarks;
}
sb.append(current);
break;
case '{':
case '[':
sb.append(current);
if (!isInQuotationMarks) {
sb.append('\n');
indent++;
addIndentBlank(sb, indent);
}
break;
case '}':
case ']':
if (!isInQuotationMarks) {
sb.append('\n');
indent--;
addIndentBlank(sb, indent);
}
sb.append(current);
break;
case ',':
sb.append(current);
if (last != '\\' && !isInQuotationMarks) {
sb.append('\n');
addIndentBlank(sb, indent);
}
break;
default:
sb.append(current);
}
}
return sb.toString();
}
private static void addIndentBlank(StringBuilder sb, int indent) {
for (int i = 0; i < indent; i++) {
sb.append('\t');
}
}
}

View File

@@ -54,12 +54,6 @@
android:layout_height="match_parent"
android:text="查看配置信息" />
<Button
android:id="@+id/btnJumpNetWorkPort"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="跳转网络基础测试" />
<Button
android:id="@+id/btnJumpRealTime"
android:layout_width="match_parent"

View File

@@ -10,6 +10,10 @@ class NetConstants {
const val READ_TIMEOUT = 20000L
const val WRITE_TIMEOUT = 20000L
const val CONNECT_TIMEOUT = 15000L
const val DEVA_HOST = "http://dzt-deva.zhidaozhixing.com"
const val LAUNCHER_SNAPSHOT_HOST = "http://dzt-launcherSnapshot.zhidaozhixing.com"
const val TECH_HOST = "http://tech-dev.zhidaozhixing.com"
}
}

View File

@@ -36,26 +36,26 @@ PASSWORD=xintai2018
RELEASE=true
# AI CLOUD 云平台
# 工具类
MOGO_UTILS_VERSION=1.4.4.2
MOGO_UTILS_VERSION=1.4.4.4
# 网络请求
MOGO_NETWORK_VERSION=1.4.4.2
MOGO_NETWORK_VERSION=1.4.4.4
# 网络DNS
MOGO_HTTPDNS_VERSION=1.4.4.2
MOGO_HTTPDNS_VERSION=1.4.4.4
# 鉴权
MOGO_PASSPORT_VERSION=1.4.4.2
MOGO_PASSPORT_VERSION=1.4.4.4
# 常链接
MOGO_SOCKET_VERSION=1.4.4.2
MOGO_SOCKET_VERSION=1.4.4.4
# 数据采集
MOGO_REALTIME_VERSION=1.4.4.2
MOGO_REALTIME_VERSION=1.4.4.4
# 探路,道路事件发布,获取
MOGO_TANLU_VERSION=1.4.4.2
MOGO_TANLU_VERSION=1.4.4.4
# 直播推流
MOGO_LIVE_VERSION=1.4.4.2
MOGO_LIVE_VERSION=1.4.4.4
# 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.4.4.2
MOGO_TRAFFICLIVE_VERSION=1.4.4.4
# 定位服务
MOGO_LOCATION_VERSION=1.4.4.2
MOGO_LOCATION_VERSION=1.4.4.4
# 远程通讯模块
MOGO_TELEMATIC_VERSION=1.4.4.2
MOGO_TELEMATIC_VERSION=1.4.4.4
# v2x
MOGO_V2X_VERSION=1.4.4.2
MOGO_V2X_VERSION=1.4.4.4