Skip to content

Commit 02f8717

Browse files
authored
Merge pull request #119 from natetrost/main
Build environment updates for AGDK samples
2 parents 3fbdbef + ea4906b commit 02f8717

20 files changed

Lines changed: 120 additions & 90 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: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -328,31 +328,41 @@ 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);
332-
ImPlot::PlotShaded("Pow drain", &graph_buffer_.Data[0].x,
333-
&graph_buffer_.Data[0].y, graph_buffer_.Data.size(),
334-
-INFINITY, 0, graph_buffer_.Offset, 2 * sizeof(float));
335-
336-
ImPlot::PlotLine("Forecast x1", &graph_buffer_forecast1_.Data[0].x,
337-
&graph_buffer_forecast1_.Data[0].y,
338-
graph_buffer_forecast1_.Data.size(), 0,
339-
graph_buffer_forecast1_.Offset, 2 * sizeof(float));
340-
ImPlot::PlotLine("x10", &graph_buffer_forecast2_.Data[0].x,
341-
&graph_buffer_forecast2_.Data[0].y,
342-
graph_buffer_forecast2_.Data.size(), 0,
343-
graph_buffer_forecast2_.Offset, 2 * sizeof(float));
344-
ImPlot::PlotLine("x100", &graph_buffer_forecast3_.Data[0].x,
345-
&graph_buffer_forecast3_.Data[0].y,
346-
graph_buffer_forecast3_.Data.size(), 0,
347-
graph_buffer_forecast3_.Offset, 2 * sizeof(float));
348-
ImPlot::PlotLine("ADPF", &graph_buffer_power1_.Data[0].x,
349-
&graph_buffer_power1_.Data[0].y,
350-
graph_buffer_power1_.Data.size(), 0,
351-
graph_buffer_power1_.Offset, 2 * sizeof(float));
352-
ImPlot::PlotLine("NOADPF", &graph_buffer_power2_.Data[0].x,
353-
&graph_buffer_power2_.Data[0].y,
354-
graph_buffer_power2_.Data.size(), 0,
355-
graph_buffer_power2_.Offset, 2 * sizeof(float));
331+
auto get_x = [](auto& buf) { return buf.Data.empty() ? nullptr : &buf.Data[0].x; };
332+
auto get_y = [](auto& buf) { return buf.Data.empty() ? nullptr : &buf.Data[0].y; };
333+
334+
ImPlot::PlotShaded("Pow drain", get_x(graph_buffer_),
335+
get_y(graph_buffer_), graph_buffer_.Data.size(),
336+
-INFINITY,
337+
ImPlotSpec(ImPlotProp_FillAlpha, 0.5f,
338+
ImPlotProp_Offset, graph_buffer_.Offset,
339+
ImPlotProp_Stride, (int)(2 * sizeof(float))));
340+
341+
ImPlot::PlotLine("Forecast x1", get_x(graph_buffer_forecast1_),
342+
get_y(graph_buffer_forecast1_),
343+
graph_buffer_forecast1_.Data.size(),
344+
ImPlotSpec(ImPlotProp_Offset, graph_buffer_forecast1_.Offset,
345+
ImPlotProp_Stride, (int)(2 * sizeof(float))));
346+
ImPlot::PlotLine("x10", get_x(graph_buffer_forecast2_),
347+
get_y(graph_buffer_forecast2_),
348+
graph_buffer_forecast2_.Data.size(),
349+
ImPlotSpec(ImPlotProp_Offset, graph_buffer_forecast2_.Offset,
350+
ImPlotProp_Stride, (int)(2 * sizeof(float))));
351+
ImPlot::PlotLine("x100", get_x(graph_buffer_forecast3_),
352+
get_y(graph_buffer_forecast3_),
353+
graph_buffer_forecast3_.Data.size(),
354+
ImPlotSpec(ImPlotProp_Offset, graph_buffer_forecast3_.Offset,
355+
ImPlotProp_Stride, (int)(2 * sizeof(float))));
356+
ImPlot::PlotLine("ADPF", get_x(graph_buffer_power1_),
357+
get_y(graph_buffer_power1_),
358+
graph_buffer_power1_.Data.size(),
359+
ImPlotSpec(ImPlotProp_Offset, graph_buffer_power1_.Offset,
360+
ImPlotProp_Stride, (int)(2 * sizeof(float))));
361+
ImPlot::PlotLine("NOADPF", get_x(graph_buffer_power2_),
362+
get_y(graph_buffer_power2_),
363+
graph_buffer_power2_.Data.size(),
364+
ImPlotSpec(ImPlotProp_Offset, graph_buffer_power2_.Offset,
365+
ImPlotProp_Stride, (int)(2 * sizeof(float))));
356366

357367
ImPlot::EndPlot();
358368
}

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: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
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.dependency.useConstraints=true
18+
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/agdktunnel/gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@ GameSDKPath=../..
2020
# Set to true to delivery optimized compressed assets using the Play Asset Delivery API
2121
PADEnabled=false
2222
android.nonTransitiveRClass=false
23-
android.uniquePackageNames=false
2423
android.dependency.useConstraints=true
2524
android.r8.strictFullModeForKeepRules=false

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

0 commit comments

Comments
 (0)