RealTime测试代码
This commit is contained in:
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@@ -23,7 +23,6 @@
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
@@ -49,4 +49,5 @@ dependencies {
|
||||
|
||||
implementation rootProject.ext.dependencies.rxjava
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
implementation project(path: ':modules:mogo-realtime')
|
||||
}
|
||||
@@ -1,19 +1,57 @@
|
||||
package com.mogo.cloud;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.widget.Button;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||
import com.mogo.realtime.core.SnapshotUploadInTime;
|
||||
import com.mogo.realtime.entity.MogoSnapshotSetData;
|
||||
import com.mogo.realtime.socket.IMogoCloudOnMsgListener;
|
||||
|
||||
import java.nio.Buffer;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 描述
|
||||
* @since: 2021/1/21
|
||||
*/
|
||||
public class RealTimeActivity extends AppCompatActivity {
|
||||
|
||||
private Button snapshotStartButton;
|
||||
private Button snapshotStopButton;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_real_time);
|
||||
setConfig();
|
||||
|
||||
snapshotStartButton = findViewById(R.id.snapshotStart);
|
||||
snapshotStartButton.setOnClickListener(view -> {
|
||||
if (MoGoAiCloudClient.getInstance().getAiCloudClientConfig().isNeedUploadCoordinatesDurationInTime()) {
|
||||
SnapshotUploadInTime.getInstance().start(getApplicationContext(), "com.mogo.launcher", new IMogoCloudOnMsgListener() {
|
||||
@Override
|
||||
public void onMsgReceived(MogoSnapshotSetData mogoSnapshotSetData) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
snapshotStopButton = findViewById(R.id.snapshotStart);
|
||||
snapshotStopButton.setOnClickListener(view -> {
|
||||
SnapshotUploadInTime.getInstance().stop();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void setConfig() {
|
||||
MoGoAiCloudClient.getInstance().getAiCloudClientConfig().setIsUseExternalLocation(false);
|
||||
MoGoAiCloudClient.getInstance().getAiCloudClientConfig().setNeedUploadCoordinatesDurationInTime(true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,10 +7,17 @@
|
||||
tools:context=".RealTimeActivity">
|
||||
|
||||
<Button
|
||||
android:id="@+id/snapshot"
|
||||
android:id="@+id/snapshotStart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="实时定位 数据上传" />
|
||||
android:text="开启实时数据上传" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/snapshotStop"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="开启实时数据上传" />
|
||||
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user