Skip to content

Commit 10e5a05

Browse files
authored
Merge pull request #779 from dji-sdk/sdk_releases/4.14
update for 4.14
2 parents 37ffe51 + 224431f commit 10e5a05

File tree

515 files changed

+7379
-1265
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

515 files changed

+7379
-1265
lines changed

Sample Code/app/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,17 @@ android {
7676
dependencies {
7777
implementation 'androidx.multidex:multidex:2.0.0'
7878
implementation 'com.squareup:otto:1.3.8'
79-
implementation('com.dji:dji-sdk:4.14-trial1', {
79+
implementation('com.dji:dji-sdk:4.14', {
8080
/**
8181
* Uncomment the "library-anti-distortion" if your app does not need Anti Distortion for Mavic 2 Pro and Mavic 2 Zoom.
8282
* Uncomment the "fly-safe-database" if you need database for release, or we will download it when DJISDKManager.getInstance().registerApp
8383
* is called.
8484
* Both will greatly reducing the size of the APK.
8585
*/
8686
exclude module: 'library-anti-distortion'
87-
exclude module: 'utmiss'
8887
//exclude module: 'fly-safe-database'
8988
})
90-
implementation 'com.dji:utmiss:1.0.8'
91-
compileOnly 'com.dji:dji-sdk-provided:4.14-trial1'
89+
compileOnly 'com.dji:dji-sdk-provided:4.14'
9290

9391
implementation 'androidx.appcompat:appcompat:1.0.0'
9492
implementation 'androidx.core:core:1.0.0'

Sample Code/app/src/main/java/com/dji/sdk/sample/demo/camera/RecordVideoView.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
import java.util.concurrent.TimeUnit;
1414

1515
import dji.common.camera.SettingsDefinitions;
16-
import dji.common.error.DJIError;
17-
import dji.common.util.CommonCallbacks;
1816

1917
/**
2018
* Created by dji on 16/1/6.

Sample Code/app/src/main/java/com/dji/sdk/sample/demo/missionoperator/WaypointMissionOperatorView.java

Lines changed: 153 additions & 170 deletions
Large diffs are not rendered by default.

Sample Code/app/src/main/java/com/dji/sdk/sample/demo/missionoperator/WaypointV2MissionOperatorView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,15 @@ public void onResult(DJIError djiError) {
147147
flightController.setMaxFlightHeight(MAX_HEIGHT, new CommonCallbacks.CompletionCallback() {
148148
@Override
149149
public void onResult(DJIError djiError) {
150-
ToastUtils.setResultToToast(djiError == null ? "Max Flight Height is set to 500m!" : djiError.getDescription());
150+
ToastUtils.setResultToToast(djiError == null ? "The maximum height is set to 500m!" : djiError.getDescription());
151151
}
152152
});
153153
break;
154154
case R.id.btn_set_maximum_radius:
155155
flightController.setMaxFlightRadius(MAX_RADIUS, new CommonCallbacks.CompletionCallback() {
156156
@Override
157157
public void onResult(DJIError djiError) {
158-
ToastUtils.setResultToToast(djiError == null ? "Max Flight Radius is set to 500m!" : djiError.getDescription());
158+
ToastUtils.setResultToToast(djiError == null ? "The maximum radius is set to 500m!" : djiError.getDescription());
159159
}
160160
});
161161
break;

Sample Code/app/src/main/java/com/dji/sdk/sample/demo/useraccount/LDMView.kt

Lines changed: 51 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,21 @@ import android.view.LayoutInflater
66
import android.view.View
77
import android.widget.LinearLayout
88
import android.widget.TextView
9-
import butterknife.OnClick
109
import com.dji.sdk.sample.R
1110
import com.dji.sdk.sample.internal.utils.ToastUtils
1211
import com.dji.sdk.sample.internal.view.PresentableView
1312
import dji.common.error.DJIError
1413
import dji.common.util.CommonCallbacks.CompletionCallbackWith
1514
import dji.sdk.sdkmanager.DJISDKManager
1615
import dji.sdk.sdkmanager.LDMManager.LDMCallback
16+
import dji.sdk.sdkmanager.LDMModule
17+
import dji.sdk.sdkmanager.LDMModuleType
1718

1819
class LDMView(context: Context?) : LinearLayout(context), PresentableView, View.OnClickListener {
1920

2021
private lateinit var ldmInfoText: TextView
21-
private var isLDMEnable: Boolean = false
22-
private var isLDMSupport: Boolean = false
22+
private var isLDMSupported: Boolean = false
23+
private var isLDMEnabled: Boolean = false
2324

2425
init {
2526
initUI(context)
@@ -36,19 +37,20 @@ class LDMView(context: Context?) : LinearLayout(context), PresentableView, View.
3637
findViewById<View>(R.id.btn_disable_ldm).setOnClickListener(this)
3738
findViewById<View>(R.id.btn_enable_rtk_network).setOnClickListener(this)
3839
findViewById<View>(R.id.btn_disable_rtk_network).setOnClickListener(this)
39-
findViewById<View>(R.id.btn_is_rtk_network_enabled).setOnClickListener(this)
40+
findViewById<View>(R.id.btn_is_enable_user_account).setOnClickListener(this)
41+
findViewById<View>(R.id.btn_is_disable_user_account).setOnClickListener(this)
4042
findViewById<View>(R.id.btn_get_ldm_license).setOnClickListener(this)
4143
}
4244

4345
private fun initListener() {
4446
DJISDKManager.getInstance().ldmManager.setCallback(object : LDMCallback {
4547
override fun onLDMEnabledChange(isEnabled: Boolean) {
46-
isLDMEnable = isEnabled;
48+
isLDMEnabled = isEnabled;
4749
handler.post { updateLdmInfo() }
4850
}
4951

5052
override fun onLDMSupportedChange(isSupported: Boolean) {
51-
isLDMSupport = isSupported;
53+
isLDMSupported = isSupported;
5254
handler.post { updateLdmInfo() }
5355
}
5456
})
@@ -68,18 +70,40 @@ class LDMView(context: Context?) : LinearLayout(context), PresentableView, View.
6870
}
6971
}
7072

71-
fun enableRTKNetwork() {
72-
val error = DJISDKManager.getInstance().ldmManager.setRTKNetworkServiceEnabled(true)
73-
ToastUtils.setResultToToast("enableRTKNetwork " + if (error == null) "success" else "error=" + error.description)
73+
fun setRTKEnabled() {
74+
var error = DJISDKManager.getInstance().ldmManager.setModuleNetworkServiceEnabled(LDMModule.Builder()
75+
.enabled(true)
76+
.moduleType(LDMModuleType.RTK)
77+
.build())
78+
ToastUtils.setResultToToast("setRTKEnabled " + if (error == null) "success" else "error=" + error.description)
79+
updateLdmInfo()
7480
}
7581

76-
fun disableRTKNetwork() {
77-
val error = DJISDKManager.getInstance().ldmManager.setRTKNetworkServiceEnabled(false)
78-
ToastUtils.setResultToToast("disableRTKNetwork " + if (error == null) "success" else "error=" + error.description)
82+
fun setRTKDisabled() {
83+
var error = DJISDKManager.getInstance().ldmManager.setModuleNetworkServiceEnabled(LDMModule.Builder()
84+
.enabled(false)
85+
.moduleType(LDMModuleType.RTK)
86+
.build())
87+
ToastUtils.setResultToToast("setRTKDisabled " + if (error == null) "success" else "error=" + error.description)
88+
updateLdmInfo()
7989
}
8090

81-
fun isRTKNetworkEnabled() {
82-
ToastUtils.setResultToToast("isRTKNetworkServiceEnabled: " + DJISDKManager.getInstance().ldmManager.isRTKNetworkServiceEnabled)
91+
fun setUserAccountEnabled() {
92+
var error = DJISDKManager.getInstance().ldmManager.setModuleNetworkServiceEnabled(LDMModule.Builder()
93+
.enabled(true)
94+
.moduleType(LDMModuleType.USER_ACCOUNT)
95+
.build())
96+
ToastUtils.setResultToToast("setUserAccountEnabled " + if (error == null) "success" else "error=" + error.description)
97+
updateLdmInfo()
98+
}
99+
100+
fun setUserAccountDisabled() {
101+
var error = DJISDKManager.getInstance().ldmManager.setModuleNetworkServiceEnabled(LDMModule.Builder()
102+
.enabled(false)
103+
.moduleType(LDMModuleType.USER_ACCOUNT)
104+
.build())
105+
ToastUtils.setResultToToast("setUserAccountDisabled " + if (error == null) "success" else "error=" + error.description)
106+
updateLdmInfo()
83107
}
84108

85109
fun getLdmLicense() {
@@ -92,10 +116,18 @@ class LDMView(context: Context?) : LinearLayout(context), PresentableView, View.
92116
ToastUtils.setResultToToast("getLdmLicense error=" + error.description)
93117
}
94118
})
119+
updateLdmInfo()
95120
}
96121

97122
private fun updateLdmInfo() {
98-
ldmInfoText.text = "LDM enabled:$isLDMEnable,LDM supported:$isLDMSupport"
123+
isLDMEnabled = DJISDKManager.getInstance().ldmManager.isLDMEnabled
124+
var isRTKEnabled = DJISDKManager.getInstance().ldmManager.isModuleNetworkServiceEnabled(LDMModuleType.RTK)
125+
var isUserAccountEnabled = DJISDKManager.getInstance().ldmManager.isModuleNetworkServiceEnabled(LDMModuleType.USER_ACCOUNT)
126+
127+
ldmInfoText.text = "LDM enabled: $isLDMEnabled\n" +
128+
"LDM supported: $isLDMSupported\n" +
129+
"isRTKEnabled: $isRTKEnabled\n" +
130+
"isUserAccountEnabled: $isUserAccountEnabled\n"
99131
}
100132

101133
override fun getDescription(): Int = R.string.component_listview_ldm
@@ -106,9 +138,10 @@ class LDMView(context: Context?) : LinearLayout(context), PresentableView, View.
106138
when (v?.id) {
107139
R.id.btn_enable_ldm -> enableLDM()
108140
R.id.btn_disable_ldm -> disableLDM()
109-
R.id.btn_enable_rtk_network -> enableRTKNetwork()
110-
R.id.btn_disable_rtk_network -> disableRTKNetwork()
111-
R.id.btn_is_rtk_network_enabled -> isRTKNetworkEnabled()
141+
R.id.btn_enable_rtk_network -> setRTKEnabled()
142+
R.id.btn_disable_rtk_network -> setRTKDisabled()
143+
R.id.btn_is_enable_user_account -> setUserAccountEnabled()
144+
R.id.btn_is_disable_user_account -> setUserAccountDisabled()
112145
R.id.btn_get_ldm_license -> getLdmLicense()
113146
}
114147
}

Sample Code/app/src/main/java/com/dji/sdk/sample/demo/utmiss/UTMISSActivity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
import android.widget.EditText;
88
import android.widget.TextView;
99

10+
import androidx.annotation.Nullable;
11+
import androidx.appcompat.app.AppCompatActivity;
12+
1013
import com.dji.sdk.sample.R;
1114

1215
import java.io.File;
1316

14-
import androidx.annotation.Nullable;
15-
import androidx.appcompat.app.AppCompatActivity;
1617
import butterknife.BindView;
1718
import butterknife.ButterKnife;
1819
import butterknife.OnClick;

0 commit comments

Comments
 (0)