RealTime测试代码
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user