Skip to content

Commit 2b11ef4

Browse files
authored
Merge pull request #1199 from dji-sdk/sdk_releases/4.16.4
Sdk releases/4.16.4
2 parents 359210c + 3a2c81d commit 2b11ef4

File tree

7 files changed

+161
-10
lines changed

7 files changed

+161
-10
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ MSDK V5 Supported Product:
55
* [M30 Series](https://www.dji.com/matrice-30?site=brandsite&from=nav)
66
* [M300 RTK](https://www.dji.com/matrice-300?site=brandsite&from=nav)
77

8-
# DJI Mobile SDK V4 for Android Latest Version 4.16.3
8+
# DJI Mobile SDK V4 for Android Latest Version 4.16.4
99

1010
## What Is This?
1111

@@ -19,21 +19,21 @@ Declare dependency via Maven:
1919
<dependency>
2020
<groupId>com.dji</groupId>
2121
<artifactId>dji-sdk</artifactId>
22-
<version>4.16.3</version>
22+
<version>4.16.4</version>
2323
</dependency>
2424

2525
<dependency>
2626
<groupId>com.dji</groupId>
2727
<artifactId>dji-sdk-provided</artifactId>
28-
<version>4.16.3</version>
28+
<version>4.16.4</version>
2929
</dependency>
3030
~~~
3131

3232
or Gradle:
3333

3434
~~~groovy
35-
compile 'com.dji:dji-sdk:4.16.3'
36-
provided 'com.dji:dji-sdk-provided:4.16.3'
35+
compile 'com.dji:dji-sdk:4.16.4'
36+
provided 'com.dji:dji-sdk-provided:4.16.4'
3737
~~~
3838

3939
For further detail on how to integrate the DJI Android SDK into your Android Studio project, please check the [Integrate SDK into Application](http://developer.dji.com/mobile-sdk/documentation/application-development-workflow/workflow-integrate.html#import-maven-dependency) tutorial.

Sample Code/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ android {
7777
dependencies {
7878
implementation 'androidx.multidex:multidex:2.0.0'
7979
implementation 'com.squareup:otto:1.3.8'
80-
implementation('com.dji:dji-sdk:4.16.3', {
80+
implementation('com.dji:dji-sdk:4.16.4', {
8181
/**
8282
* Uncomment the "library-anti-distortion" if your app does not need Anti Distortion for Mavic 2 Pro and Mavic 2 Zoom.
8383
* Uncomment the "fly-safe-database" if you need database for release, or we will download it when DJISDKManager.getInstance().registerApp
@@ -87,7 +87,7 @@ dependencies {
8787
exclude module: 'library-anti-distortion'
8888
//exclude module: 'fly-safe-database'
8989
})
90-
compileOnly 'com.dji:dji-sdk-provided:4.16.3'
90+
compileOnly 'com.dji:dji-sdk-provided:4.16.4'
9191

9292
implementation 'androidx.appcompat:appcompat:1.0.0'
9393
implementation 'androidx.core:core:1.0.0'
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
package com.dji.sdk.sample.demo.rid;
2+
3+
import android.app.Service;
4+
import android.content.Context;
5+
import android.view.LayoutInflater;
6+
import android.view.View;
7+
import android.widget.Button;
8+
import android.widget.LinearLayout;
9+
import android.widget.TextView;
10+
11+
import com.dji.sdk.sample.R;
12+
import com.dji.sdk.sample.internal.utils.Helper;
13+
import com.dji.sdk.sample.internal.utils.PopupUtils;
14+
import com.dji.sdk.sample.internal.view.PresentableView;
15+
16+
import androidx.annotation.NonNull;
17+
import dji.sdk.sdkmanager.DJISDKManager;
18+
import dji.sdk.uas.AreaCode;
19+
import dji.sdk.uas.UASRemoteIDStatus;
20+
import dji.sdk.uas.UASRemoteIDStatusListener;
21+
22+
import static com.google.android.gms.internal.zzahn.runOnUiThread;
23+
24+
public class UASView extends LinearLayout implements View.OnClickListener, PresentableView {
25+
26+
Button changeUasCountryBtn;
27+
TextView uasInfoTV;
28+
29+
private final UASRemoteIDStatusListener uasRemoteIDStatusListener = new UASRemoteIDStatusListener() {
30+
@Override
31+
public void onUpdate(UASRemoteIDStatus uasRemoteIDStatus) {
32+
runOnUiThread(()-> uasInfoTV.setText(uasRemoteIDStatus.toString()));
33+
}
34+
};
35+
36+
public UASView(Context context) {
37+
super(context);
38+
setOrientation(LinearLayout.HORIZONTAL);
39+
setClickable(true);
40+
LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Service.LAYOUT_INFLATER_SERVICE);
41+
layoutInflater.inflate(R.layout.view_uas, this, true);
42+
init();
43+
}
44+
45+
private void init() {
46+
47+
}
48+
49+
private void initUI() {
50+
changeUasCountryBtn = findViewById(R.id.btn_change_uas_country);
51+
uasInfoTV = findViewById(R.id.tv_uas_info);
52+
initOnclickListener();
53+
}
54+
55+
private void initOnclickListener() {
56+
changeUasCountryBtn.setOnClickListener(this);
57+
}
58+
59+
@Override
60+
protected void onAttachedToWindow() {
61+
super.onAttachedToWindow();
62+
initUI();
63+
}
64+
65+
@Override
66+
public void onClick(View v) {
67+
if (v != null) {
68+
switch (v.getId()) {
69+
case R.id.btn_change_uas_country:
70+
changeUasCountry();
71+
break;
72+
default:
73+
break;
74+
}
75+
}
76+
}
77+
78+
void changeUasCountry() {
79+
final AreaCode[] areaCodes = AreaCode.values();
80+
final Runnable r = () -> {
81+
DJISDKManager.getInstance().getUasRemoteIDManager().setAreaCode(areaCodes[PopupUtils.INSTANCE.getIndex()[0]]);
82+
initUasListener();
83+
PopupUtils.INSTANCE.resetIndex();
84+
};
85+
PopupUtils.INSTANCE.initPopupNumberPicker(Helper.makeList(areaCodes), r,this);
86+
}
87+
88+
private void initUasListener() {
89+
uasInfoTV.setText("");
90+
DJISDKManager.getInstance().getUasRemoteIDManager().addUASRemoteIDStatusListener(uasRemoteIDStatusListener);
91+
}
92+
93+
@Override
94+
public int getDescription() {
95+
return R.string.uas_view;
96+
}
97+
98+
@NonNull
99+
@Override
100+
public String getHint() {
101+
return this.getClass().getSimpleName() + ".java";
102+
}
103+
104+
}

Sample Code/app/src/main/java/com/dji/sdk/sample/internal/view/DemoListView.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
import com.dji.sdk.sample.demo.radar.RadarView;
5555
import com.dji.sdk.sample.demo.remotecontroller.DualRemoteControllerView;
5656
import com.dji.sdk.sample.demo.remotecontroller.PushRemoteControllerDataView;
57+
import com.dji.sdk.sample.demo.rid.UASView;
5758
import com.dji.sdk.sample.demo.timeline.TimelineMissionControlView;
5859
import com.dji.sdk.sample.demo.useraccount.LDMView;
5960
import com.dji.sdk.sample.internal.controller.DJISampleApplication;
@@ -94,6 +95,7 @@ private void initView(Context context) {
9495
ListItem.ListBuilder builder = new ListItem.ListBuilder();
9596
builder.addGroup(R.string.component_listview_sdk_4_16,
9697
false,
98+
new GroupItem(R.string.uas_view, UASView.class),
9799
new GroupItem(R.string.look_at_mission, LookAtMissionView.class));
98100
builder.addGroup(R.string.component_listview_sdk_4_15,
99101
false,

Sample Code/app/src/main/java/com/dji/sdk/sample/internal/view/MainContent.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
import com.dji.sdk.sample.internal.utils.ToastUtils;
3636
import com.squareup.otto.Subscribe;
3737

38-
import dji.sdk.sdkmanager.LDMModule;
39-
import dji.sdk.sdkmanager.LDMModuleType;
4038
import java.util.ArrayList;
4139
import java.util.List;
4240
import java.util.concurrent.atomic.AtomicBoolean;
@@ -61,6 +59,8 @@
6159
import dji.sdk.sdkmanager.BluetoothProductConnector;
6260
import dji.sdk.sdkmanager.DJISDKInitEvent;
6361
import dji.sdk.sdkmanager.DJISDKManager;
62+
import dji.sdk.sdkmanager.LDMModule;
63+
import dji.sdk.sdkmanager.LDMModuleType;
6464
import dji.sdk.useraccount.UserAccountManager;
6565

6666
/**
@@ -478,7 +478,6 @@ private void checkAndRequestPermissions() {
478478
missingPermission.toArray(new String[missingPermission.size()]),
479479
REQUEST_PERMISSION_CODE);
480480
}
481-
482481
}
483482

484483
private void startSDKRegistration() {
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<merge xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent">
5+
6+
<LinearLayout
7+
android:layout_width="match_parent"
8+
android:layout_height="wrap_content"
9+
android:orientation="horizontal">
10+
11+
<LinearLayout
12+
android:layout_width="wrap_content"
13+
android:layout_height="wrap_content"
14+
android:orientation="vertical">
15+
16+
<Button
17+
android:id="@+id/btn_change_uas_country"
18+
style="@style/common_button"
19+
android:layout_alignParentLeft="true"
20+
android:layout_marginLeft="5dp"
21+
android:layout_marginTop="20dp"
22+
android:text="Change UAS Country" />
23+
</LinearLayout>
24+
25+
<ScrollView
26+
android:layout_width="250dp"
27+
android:layout_height="200dp"
28+
android:layout_alignParentRight="true"
29+
android:layout_marginLeft="5dp"
30+
android:layout_marginTop="10dp"
31+
android:layout_marginRight="5dp"
32+
android:scrollbars="vertical">
33+
34+
<TextView
35+
android:id="@+id/tv_uas_info"
36+
android:layout_width="wrap_content"
37+
android:layout_height="wrap_content"
38+
android:scrollbars="vertical"
39+
android:textColor="@color/black" />
40+
</ScrollView>
41+
42+
</LinearLayout>
43+
44+
</merge>

Sample Code/app/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,4 +362,6 @@
362362
<string name="laser_enable">Laser Enabled</string>
363363
<string name="split_screen_display">Split Screen Display</string>
364364

365+
<string name="uas_view">UAS</string>
366+
365367
</resources>

0 commit comments

Comments
 (0)