Skip to content

Commit 8d80ec8

Browse files
Merge pull request #202 from matthieu-db/update_mavsdk_3.5
Update mavsdk-server to 3.5.0
2 parents dd7e6a3 + 4279c7c commit 8d80ec8

File tree

17 files changed

+71
-61
lines changed

17 files changed

+71
-61
lines changed

examples/android-client/app/build.gradle

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ configurations {
77
android {
88
namespace "io.mavsdk.androidclient"
99

10-
compileSdkVersion 33
11-
1210
compileOptions {
1311
sourceCompatibility JavaVersion.VERSION_17
1412
targetCompatibility JavaVersion.VERSION_17
@@ -17,10 +15,12 @@ android {
1715
defaultConfig {
1816
applicationId "io.mavsdk.androidclient"
1917
minSdkVersion 21
20-
targetSdkVersion 33
18+
compileSdk 35
19+
targetSdkVersion 35
2120
versionCode 2
2221
versionName "1.1"
2322
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
23+
resValue "string", "mapbox_access_token", project.property("mapbox_access_token")
2424
}
2525
buildTypes {
2626
release {
@@ -30,7 +30,7 @@ android {
3030
}
3131
}
3232

33-
task checkstyle(type: Checkstyle) {
33+
tasks.register('checkstyle', Checkstyle) {
3434
configFile = rootProject.file("config/checkstyle/checkstyle.xml")
3535
source 'src'
3636
include '**/*.java'
@@ -53,19 +53,18 @@ build.dependsOn 'checkstyle'
5353
dependencies {
5454
checkstyleClasspath 'com.puppycrawl.tools:checkstyle:8.17'
5555

56-
implementation 'androidx.appcompat:appcompat:1.2.0'
56+
implementation 'androidx.appcompat:appcompat:1.7.0'
5757
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
58-
implementation 'com.github.tony19:logback-android:2.0.0'
59-
implementation 'com.google.android.material:material:1.2.0'
60-
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
58+
implementation 'com.github.tony19:logback-android:3.0.0'
59+
implementation 'com.google.android.material:material:1.12.0'
6160
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
62-
implementation 'com.mapbox.mapboxsdk:mapbox-android-telemetry:7.0.0'
61+
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
6362
implementation 'io.mavsdk:mavsdk:2.1.0'
64-
implementation 'io.mavsdk:mavsdk-server:2.1.0'
65-
implementation 'org.slf4j:slf4j-api:2.0.13'
63+
implementation 'io.mavsdk:mavsdk-server:2.1.6'
64+
implementation 'org.slf4j:slf4j-api:2.0.17'
6665

67-
testImplementation 'junit:junit:4.13'
66+
testImplementation 'junit:junit:4.13.2'
6867

69-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
70-
androidTestImplementation 'androidx.test:runner:1.2.0'
68+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
69+
androidTestImplementation 'androidx.test:runner:1.6.2'
7170
}

examples/android-client/app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
<activity
1717
android:name=".MapsActivity"
18-
android:label="@string/app_name"
1918
android:exported="true">
2019
<intent-filter>
2120
<action android:name="android.intent.action.MAIN" />

examples/android-client/app/src/main/java/io/mavsdk/androidclient/MapsActivity.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import androidx.annotation.NonNull;
1111
import androidx.annotation.Nullable;
1212
import androidx.appcompat.app.AppCompatActivity;
13+
import androidx.appcompat.widget.Toolbar;
1314
import androidx.lifecycle.Observer;
1415
import androidx.lifecycle.ViewModelProviders;
1516
import com.google.android.material.floatingactionbutton.FloatingActionButton;
@@ -71,8 +72,10 @@ public class MapsActivity extends AppCompatActivity implements OnMapReadyCallbac
7172
@Override
7273
public void onCreate(Bundle savedInstanceState) {
7374
super.onCreate(savedInstanceState);
74-
Mapbox.getInstance(this, getString(R.string.access_token));
75+
Mapbox.getInstance(this, getString(R.string.mapbox_access_token));
7576
setContentView(R.layout.activity_maps);
77+
Toolbar toolbar = findViewById(R.id.toolbar);
78+
setSupportActionBar(toolbar);
7679
mapView = findViewById(R.id.mapView);
7780
mapView.onCreate(savedInstanceState);
7881
mapView.getMapAsync(this);
Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,50 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
2+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
44
android:id="@+id/container"
55
android:layout_height="match_parent"
6-
android:layout_width="match_parent">
6+
android:layout_width="match_parent"
7+
android:fitsSystemWindows="true">
8+
9+
<com.google.android.material.appbar.MaterialToolbar
10+
android:id="@+id/toolbar"
11+
android:layout_width="match_parent"
12+
android:layout_height="?attr/actionBarSize"
13+
app:layout_constraintTop_toTopOf="parent" />
714

815
<com.mapbox.mapboxsdk.maps.MapView
916
android:id="@+id/mapView"
1017
android:layout_width="match_parent"
11-
android:layout_height="match_parent"
12-
mapbox:mapbox_cameraTargetLat="41.885"
13-
mapbox:mapbox_cameraTargetLng="-87.679"
14-
mapbox:mapbox_cameraTilt="60"
15-
mapbox:mapbox_cameraZoom="12"/>
18+
android:layout_height="0dp"
19+
app:mapbox_cameraTargetLat="41.885"
20+
app:mapbox_cameraTargetLng="-87.679"
21+
app:mapbox_cameraTilt="60"
22+
app:mapbox_cameraZoom="12"
23+
app:layout_constraintTop_toBottomOf="@id/toolbar"/>
1624

1725
<com.google.android.material.floatingactionbutton.FloatingActionButton
1826
android:id="@+id/fab"
1927
android:layout_width="wrap_content"
2028
android:layout_height="wrap_content"
2129
android:layout_margin="16dp"
2230
android:src="@drawable/ic_play_arrow_black_24dp"
23-
android:tint="@color/white"
24-
android:layout_gravity="end|bottom"/>
31+
app:layout_constraintBottom_toBottomOf="parent"
32+
app:layout_constraintEnd_toEndOf="parent" />
2533

26-
<Button
34+
<com.google.android.material.button.MaterialButton
2735
android:id="@+id/buttonRunDestroyMavsdkServer"
2836
android:layout_width="wrap_content"
2937
android:layout_height="wrap_content"
3038
android:layout_margin="16dp"
3139
android:text="@string/run_mavsdk_server"
32-
android:layout_gravity="start|top"/>
40+
app:layout_constraintTop_toBottomOf="@id/toolbar"
41+
app:layout_constraintStart_toStartOf="parent"/>
3342

3443
<FrameLayout
3544
android:id="@+id/start_mission_fragment_container"
3645
android:layout_width="match_parent"
37-
android:layout_height="match_parent"/>
46+
android:layout_height="0dp"
47+
app:layout_constraintTop_toBottomOf="@id/toolbar"
48+
app:layout_constraintBottom_toBottomOf="parent"/>
3849

39-
</FrameLayout>
50+
</androidx.constraintlayout.widget.ConstraintLayout>

examples/android-client/app/src/main/res/values/colors.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

examples/android-client/app/src/main/res/values/strings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<resources>
22
<string name="app_name">MAVSDK Android Client</string>
33

4-
<string name="access_token">pk.eyJ1IjoibWF2ZHNrLWphdmEtc2FtcGxlIiwiYSI6ImNrMGZjY2lxNTBpbzIzZ2xjaGlsNDZ5YXkifQ.f0jCQvYbGQecPCFFy_3jSA</string>
54
<string name="kill">Kill</string>
65
<string name="return_home">Return</string>
76
<string name="land">Land</string>
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
<resources>
22

33
<!-- Base application theme. -->
4-
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
5-
<!-- Customize your theme here. -->
6-
<item name="colorPrimary">@color/colorPrimary</item>
7-
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
8-
<item name="colorAccent">@color/colorAccent</item>
9-
</style>
4+
<style name="AppTheme" parent="Theme.Material3.DayNight.NoActionBar"/>
105

116
</resources>

examples/android-client/build.gradle

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,27 @@ buildscript {
55
}
66

77
dependencies {
8-
classpath 'com.android.tools.build:gradle:8.4.1'
8+
classpath 'com.android.tools.build:gradle:8.10.0'
99
}
1010
}
1111

1212
allprojects {
1313
repositories {
1414
google()
15+
maven {
16+
url 'https://api.mapbox.com/downloads/v2/releases/maven'
17+
authentication {
18+
basic(BasicAuthentication)
19+
}
20+
credentials {
21+
username = "mapbox"
22+
password = project.properties["mapbox_access_token"]
23+
}
24+
}
1525
jcenter()
1626
}
1727
}
1828

19-
task clean(type: Delete) {
29+
tasks.register('clean', Delete) {
2030
delete rootProject.buildDir
2131
}

examples/android-client/gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ org.gradle.jvmargs=-Xmx1536m
1616
# https://developer.android.com/topic/libraries/support-library/androidx-rn
1717
android.useAndroidX=true
1818
# Automatically convert third-party libraries to use AndroidX
19-
android.enableJetifier=true
19+
android.enableJetifier=false
2020

21+
mapbox_access_token=pk.eyJ1IjoibWF2ZHNrLWphdmEtc2FtcGxlIiwiYSI6ImNrMGZjY2lxNTBpbzIzZ2xjaGlsNDZ5YXkifQ.f0jCQvYbGQecPCFFy_3jSA

examples/android-client/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip

0 commit comments

Comments
 (0)