Skip to content

Commit f17b519

Browse files
committed
Build environment updates for AGDK samples
Updates the gradle/AGP/AGDK/dependency versions of the ADPF, game controller and game mode samples to bring them up to date (matching AGDKTunnel). Updated README to reflect target Android Studio version. Minor compile fix for compatibility with current implot.
1 parent 3fbdbef commit f17b519

19 files changed

Lines changed: 107 additions & 76 deletions

agdk/adpf/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The sample:
1515

1616
## Prerequisites
1717

18-
Before building in Android Studio 2024.3.1 Patch 1 (Meerkat) the following prerequisites must be
18+
Before building in Android Studio 2026.1.1 Patch 1 (Quail 1) or higher the following prerequisites must be
1919
performed:
2020

2121
## Requirements
@@ -57,6 +57,10 @@ https://developer.android.com/reference/android/os/PowerManager
5757

5858
https://developer.android.com/ndk/reference/group/thermal
5959

60+
## Version history
61+
62+
1.2.3 - Updated to current AGDK/NDK/AGP versions, 16KB page compatible fix
63+
6064
## License
6165

6266
Copyright 2022 The Android Open Source Project

agdk/adpf/app/build.gradle

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
apply plugin: 'com.android.application'
1818

1919
android {
20-
compileSdkVersion 36
21-
ndkVersion '27.2.12479018'
20+
compileSdkVersion 37
21+
ndkVersion '29.0.14206865'
2222

2323
defaultConfig {
2424
applicationId 'com.android.example.games.adpf'
2525
minSdkVersion 24
26-
targetSdkVersion 36
27-
versionCode 5
28-
versionName '1.2.2'
26+
targetSdkVersion 37
27+
versionCode 6
28+
versionName '1.2.3'
2929
externalNativeBuild {
3030
cmake {
3131
arguments '-DANDROID_STL=c++_shared',
@@ -36,7 +36,7 @@ android {
3636
buildTypes {
3737
release {
3838
minifyEnabled = false
39-
proguardFiles getDefaultProguardFile('proguard-android.txt'),
39+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
4040
'proguard-rules.pro'
4141
}
4242
}
@@ -55,14 +55,15 @@ android {
5555
}
5656

5757
dependencies {
58-
implementation "androidx.lifecycle:lifecycle-viewmodel:2.2.0"
59-
implementation "androidx.lifecycle:lifecycle-livedata:2.2.0"
60-
implementation "androidx.lifecycle:lifecycle-runtime:2.2.0"
61-
implementation "androidx.core:core:1.5.0"
62-
implementation "androidx.constraintlayout:constraintlayout:2.0.4"
63-
implementation 'androidx.fragment:fragment:1.2.5'
64-
implementation "androidx.games:games-activity:3.0.5"
65-
implementation "androidx.games:games-frame-pacing:2.1.2"
58+
implementation "androidx.appcompat:appcompat:1.6.1"
59+
implementation "androidx.lifecycle:lifecycle-viewmodel:2.10.0"
60+
implementation "androidx.lifecycle:lifecycle-livedata:2.10.0"
61+
implementation "androidx.lifecycle:lifecycle-runtime:2.10.0"
62+
implementation "androidx.core:core:1.19.0"
63+
implementation "androidx.constraintlayout:constraintlayout:2.2.1"
64+
implementation 'androidx.fragment:fragment:1.8.9'
65+
implementation "androidx.games:games-activity:4.4.2"
66+
implementation "androidx.games:games-frame-pacing:2.1.3"
6667

6768
// Example of using local .aar files in libs/ directory.
6869
// Comment out the androidx.games implementation lines if

agdk/adpf/app/src/main/cpp/demo_scene.cpp

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -328,31 +328,38 @@ void DemoScene::RenderPanel() {
328328
ImPlot::SetupAxisLimits(ImAxis_X1, t - history, t, ImGuiCond_Always);
329329
ImPlot::SetupAxisLimits(ImAxis_Y1, -10000, 10000);
330330

331-
ImPlot::SetNextFillStyle(IMPLOT_AUTO_COL, 0.5f);
332331
ImPlot::PlotShaded("Pow drain", &graph_buffer_.Data[0].x,
333332
&graph_buffer_.Data[0].y, graph_buffer_.Data.size(),
334-
-INFINITY, 0, graph_buffer_.Offset, 2 * sizeof(float));
333+
-INFINITY,
334+
ImPlotSpec(ImPlotProp_FillAlpha, 0.5f,
335+
ImPlotProp_Offset, graph_buffer_.Offset,
336+
ImPlotProp_Stride, (int)(2 * sizeof(float))));
335337

336338
ImPlot::PlotLine("Forecast x1", &graph_buffer_forecast1_.Data[0].x,
337339
&graph_buffer_forecast1_.Data[0].y,
338-
graph_buffer_forecast1_.Data.size(), 0,
339-
graph_buffer_forecast1_.Offset, 2 * sizeof(float));
340+
graph_buffer_forecast1_.Data.size(),
341+
ImPlotSpec(ImPlotProp_Offset, graph_buffer_forecast1_.Offset,
342+
ImPlotProp_Stride, (int)(2 * sizeof(float))));
340343
ImPlot::PlotLine("x10", &graph_buffer_forecast2_.Data[0].x,
341344
&graph_buffer_forecast2_.Data[0].y,
342-
graph_buffer_forecast2_.Data.size(), 0,
343-
graph_buffer_forecast2_.Offset, 2 * sizeof(float));
345+
graph_buffer_forecast2_.Data.size(),
346+
ImPlotSpec(ImPlotProp_Offset, graph_buffer_forecast2_.Offset,
347+
ImPlotProp_Stride, (int)(2 * sizeof(float))));
344348
ImPlot::PlotLine("x100", &graph_buffer_forecast3_.Data[0].x,
345349
&graph_buffer_forecast3_.Data[0].y,
346-
graph_buffer_forecast3_.Data.size(), 0,
347-
graph_buffer_forecast3_.Offset, 2 * sizeof(float));
350+
graph_buffer_forecast3_.Data.size(),
351+
ImPlotSpec(ImPlotProp_Offset, graph_buffer_forecast3_.Offset,
352+
ImPlotProp_Stride, (int)(2 * sizeof(float))));
348353
ImPlot::PlotLine("ADPF", &graph_buffer_power1_.Data[0].x,
349354
&graph_buffer_power1_.Data[0].y,
350-
graph_buffer_power1_.Data.size(), 0,
351-
graph_buffer_power1_.Offset, 2 * sizeof(float));
355+
graph_buffer_power1_.Data.size(),
356+
ImPlotSpec(ImPlotProp_Offset, graph_buffer_power1_.Offset,
357+
ImPlotProp_Stride, (int)(2 * sizeof(float))));
352358
ImPlot::PlotLine("NOADPF", &graph_buffer_power2_.Data[0].x,
353359
&graph_buffer_power2_.Data[0].y,
354-
graph_buffer_power2_.Data.size(), 0,
355-
graph_buffer_power2_.Offset, 2 * sizeof(float));
360+
graph_buffer_power2_.Data.size(),
361+
ImPlotSpec(ImPlotProp_Offset, graph_buffer_power2_.Offset,
362+
ImPlotProp_Stride, (int)(2 * sizeof(float))));
356363

357364
ImPlot::EndPlot();
358365
}

agdk/adpf/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ buildscript {
2222
mavenCentral()
2323
}
2424
dependencies {
25-
classpath 'com.android.tools.build:gradle:8.9.1'
25+
classpath 'com.android.tools.build:gradle:9.2.1'
2626
}
2727
}
2828

agdk/adpf/gradle.properties

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1212
# org.gradle.parallel=true
1313
#Wed Nov 18 14:49:00 GMT 2020
14-
android.enableJetifier=true
1514
android.useAndroidX=true
1615

17-
android.prefabVersion=2.0.0
18-
android.defaults.buildfeatures.buildconfig=true
1916
android.nonTransitiveRClass=false
20-
android.nonFinalResIds=false
17+
android.uniquePackageNames=false
18+
android.dependency.useConstraints=true
19+
android.r8.strictFullModeForKeepRules=false

agdk/adpf/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

agdk/adpf/settings.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
plugins {
2+
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.10.0'
3+
}
4+
15
/*
26
* Copyright 2021 The Android Open Source Project
37
*

agdk/game_controller/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ such as vibration
1212

1313
## Prerequisites
1414

15-
Before building in Android Studio 2024.3.1 Patch 1 (Meerkat) or higher the following prerequisites
15+
Before building in Android Studio 2026.1.1 Patch 1 (Quail 1) or higher the following prerequisites
1616
must be performed:
1717

1818
### ImGui
@@ -22,9 +22,13 @@ must be performed:
2222

2323
## Building
2424

25-
Open the `game_controller` directory in Android Studio 2021.2 or higher. You can
25+
Open the `game_controller` directory in Android Studio 2026.1.1 Patch 1 (Quail 1) or higher. You can
2626
then build and run the samples from Android Studio.
2727

28+
## Version history
29+
30+
1.1.4 - Updated to current AGDK/NDK/AGP versions, 16KB page compatible fix
31+
2832
## License
2933

3034
Copyright 2021 The Android Open Source Project

agdk/game_controller/app/build.gradle

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
apply plugin: 'com.android.application'
1818

1919
android {
20-
compileSdkVersion 36
21-
ndkVersion '27.2.12479018'
20+
compileSdkVersion 37
21+
ndkVersion '29.0.14206865'
2222

2323
defaultConfig {
2424
applicationId 'com.google.android.games.paddleboat.gamecontrollersample'
2525
minSdkVersion 24
26-
targetSdkVersion 36
27-
versionCode 5
28-
versionName '1.1.3'
26+
targetSdkVersion 37
27+
versionCode 6
28+
versionName '1.1.4'
2929
externalNativeBuild {
3030
cmake {
3131
arguments '-DANDROID_STL=c++_shared',
@@ -36,7 +36,7 @@ android {
3636
buildTypes {
3737
release {
3838
minifyEnabled = false
39-
proguardFiles getDefaultProguardFile('proguard-android.txt'),
39+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
4040
'proguard-rules.pro'
4141
}
4242
}
@@ -55,13 +55,14 @@ android {
5555
}
5656

5757
dependencies {
58-
implementation "androidx.lifecycle:lifecycle-viewmodel:2.2.0"
59-
implementation "androidx.lifecycle:lifecycle-livedata:2.2.0"
60-
implementation "androidx.lifecycle:lifecycle-runtime:2.2.0"
61-
implementation "androidx.core:core:1.5.0"
62-
implementation "androidx.constraintlayout:constraintlayout:2.0.4"
63-
implementation 'androidx.fragment:fragment:1.2.5'
64-
implementation "androidx.games:games-activity:3.0.5"
58+
implementation "androidx.appcompat:appcompat:1.6.1"
59+
implementation "androidx.lifecycle:lifecycle-viewmodel:2.10.0"
60+
implementation "androidx.lifecycle:lifecycle-livedata:2.10.0"
61+
implementation "androidx.lifecycle:lifecycle-runtime:2.10.0"
62+
implementation "androidx.core:core:1.19.0"
63+
implementation "androidx.constraintlayout:constraintlayout:2.2.1"
64+
implementation 'androidx.fragment:fragment:1.8.9'
65+
implementation "androidx.games:games-activity:4.4.2"
6566
implementation "androidx.games:games-controller:2.0.2"
6667
implementation "com.android.ndk.thirdparty:libpng:1.6.37-alpha-1"
6768

agdk/game_controller/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ buildscript {
2222
mavenCentral()
2323
}
2424
dependencies {
25-
classpath 'com.android.tools.build:gradle:8.9.1'
25+
classpath 'com.android.tools.build:gradle:9.2.1'
2626
}
2727
}
2828

0 commit comments

Comments
 (0)