diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index e31268c0f..7cfd40304 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -24,11 +24,11 @@ jobs: runs-on: macos-15 env: QT_VERSION: '6.8.3' # use scripts/update_qt_version.bash to change - NDK_VERSION: 'r26' # '26.1.10909125' - NDK_VERSION_FULL: r26b + NDK_VERSION: 'r27' # '27.2.12479018' + NDK_VERSION_FULL: r27c JDK_VERSION: 17 - SDK_PLATFORM: android-34 - SDK_BUILD_TOOLS: 34.0.0 + SDK_PLATFORM: android-35 + SDK_BUILD_TOOLS: 35.0.0 INPUT_SDK_VERSION_ARM: arm-android-20250326-241 INPUT_SDK_VERSION_ARM64: arm64-android-20250326-241 CCACHE_DIR: /Users/runner/work/ccache diff --git a/CMakeLists.txt b/CMakeLists.txt index 6145e35be..87a3c674a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ if (DEFINED ENV{INPUT_SDK_ANDROID_BASE}) set(ANDROID_STL "c++_shared") # Target/Minimum API levels for Android, used as Input target properties - set(INPUT_ANDROID_TARGET_SDK_VERSION "34") + set(INPUT_ANDROID_TARGET_SDK_VERSION "35") set(INPUT_ANDROID_MIN_SDK_VERSION "${ANDROIDAPI}") set(INPUT_ANDROID_NDK_PATH "$ENV{ANDROID_NDK_ROOT}") if (NOT INPUT_ANDROID_NDK_PATH) diff --git a/app/android/src/uk/co/lutraconsulting/InputActivity.java b/app/android/src/uk/co/lutraconsulting/InputActivity.java index a6c4224ab..28bdd7a25 100644 --- a/app/android/src/uk/co/lutraconsulting/InputActivity.java +++ b/app/android/src/uk/co/lutraconsulting/InputActivity.java @@ -83,20 +83,23 @@ void setCustomStatusAndNavBar() if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) { Log.d( TAG, "Unsupported Android version for painting behind system bars." ); return; - } + } else { WindowCompat.setDecorFitsSystemWindows(getWindow(), false); Window window = getWindow(); - // draw app edge-to-edge - window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); - - // make the status bar background color transparent - window.setStatusBarColor(Color.TRANSPARENT); - - // make the navigation button background color transparent - window.setNavigationBarColor(Color.TRANSPARENT); + // on Android 15+ all apps are edge-to-edge + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.VANILLA_ICE_CREAM) { + // draw app edge-to-edge + window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); + + // make the status bar background color transparent + window.setStatusBarColor(Color.TRANSPARENT); + + // make the navigation button background color transparent + window.setNavigationBarColor(Color.TRANSPARENT); + } // do not show background dim for the navigation buttons window.setNavigationBarContrastEnforced(false); diff --git a/cmake_templates/AndroidManifest.xml.in b/cmake_templates/AndroidManifest.xml.in index 98db061c0..0aa6e15a4 100644 --- a/cmake_templates/AndroidManifest.xml.in +++ b/cmake_templates/AndroidManifest.xml.in @@ -1,6 +1,5 @@ @@ -34,28 +33,25 @@ android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" /> - + android:roundIcon="@mipmap/ic_appicon_round" > - - + + @@ -79,26 +75,6 @@ - - - - - - - - - - @@ -108,7 +84,7 @@ android:parentActivityName="uk.co.lutraconsulting.InputActivity" android:configChanges="screenLayout|orientation|screenSize" > - + - + diff --git a/cmake_templates/build.gradle.in b/cmake_templates/build.gradle.in index c83f1abab..76aa2b38f 100644 --- a/cmake_templates/build.gradle.in +++ b/cmake_templates/build.gradle.in @@ -1,20 +1,13 @@ -/* keep in sync with /opt/Qt//android//src/android/templates/build.gradle */ +/* keep in sync with /opt/Qt//android/src/android/templates/build.gradle */ buildscript { - ext { - buildToolsVersion = androidBuildToolsVersion - compileSdkVersion = androidCompileSdkVersion.toInteger() - targetSdkVersion = androidCompileSdkVersion.toInteger() - ndkVersion = androidNdkVersion - } - repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.1' + classpath 'com.android.tools.build:gradle:8.6.0' } } @@ -23,17 +16,16 @@ repositories { mavenCentral() } -apply plugin: 'com.android.application' +apply plugin: qtGradlePluginType dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) - implementation "androidx.appcompat:appcompat:1.4.1" - implementation "androidx.core:core:1.8.0" - implementation 'androidx.core:core-splashscreen:1.0.0-beta02' - implementation "androidx.exifinterface:exifinterface:1.3.3" - implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.google.android.gms:play-services-location:21.2.0' + implementation "androidx.appcompat:appcompat:1.7.1" + implementation "androidx.core:core:1.13.1" + implementation "androidx.core:core-splashscreen:1.0.1" + implementation "androidx.exifinterface:exifinterface:1.4.1" + implementation "com.google.android.gms:play-services-location:21.3.0" } android { @@ -50,7 +42,8 @@ android { * Changing them manually might break the compilation! *******************************************************/ - compileSdkVersion androidCompileSdkVersion.toInteger() + namespace 'uk.co.lutraconsulting' + compileSdkVersion androidCompileSdkVersion buildToolsVersion androidBuildToolsVersion ndkVersion androidNdkVersion ndkPath '@INPUT_ANDROID_NDK_PATH@'