Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 12 additions & 9 deletions app/android/src/uk/co/lutraconsulting/InputActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
34 changes: 5 additions & 29 deletions cmake_templates/AndroidManifest.xml.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="uk.co.lutraconsulting"
android:installLocation="auto"
android:versionCode="@INPUT_VERSION_CODE@"
android:versionName="@INPUT_VERSION@">
Expand Down Expand Up @@ -34,28 +33,25 @@
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" />
<!-- "allowBackup" is suspicious, see https://developer.android.com/guide/topics/manifest/application-element#allowbackup -->
<application
android:name="org.qtproject.qt.android.bindings.QtApplication"
android:hardwareAccelerated="true"
android:label="Mergin Maps"
android:allowNativeHeapPointerTagging="false"
android:allowBackup="true"
android:fullBackupOnly="false"
android:icon="@mipmap/ic_appicon"
android:roundIcon="@mipmap/ic_appicon_round">
android:roundIcon="@mipmap/ic_appicon_round" >
<activity
android:name="uk.co.lutraconsulting.InputActivity"
android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density"
android:label="Mergin Maps"
android:launchMode="singleTop"
android:screenOrientation="unspecified"
android:exported="true"
android:theme="@style/Theme.App.Starting"
>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<!-- Get access to images/videos -->
Expand All @@ -79,26 +75,6 @@
<meta-data
android:name="android.app.arguments"
android:value="-- %%INSERT_APP_ARGUMENTS%% --" />

<!-- Background running -->
<!-- Warning: changing this value to true may cause unexpected crashes if the
application still try to draw after
"applicationStateChanged(Qt::ApplicationSuspended)"
signal is sent! -->
<meta-data android:name="android.app.background_running" android:value="false"/>
<!-- Background running -->

<!-- extract android style -->
<!-- available android:values :
* default - In most cases this will be the same as "full", but it can also be something else if needed, e.g., for compatibility reasons
* full - useful QWidget & Quick Controls 1 apps
* minimal - useful for Quick Controls 2 apps, it is much faster than "full"
* none - useful for apps that don't use any of the above Qt modules
-->
<meta-data
android:name="android.app.extract_android_style"
android:value="minimal" />
<!-- extract android style -->
</activity>

<!-- Activity Android native camera -->
Expand All @@ -108,7 +84,7 @@
android:parentActivityName="uk.co.lutraconsulting.InputActivity"
android:configChanges="screenLayout|orientation|screenSize"
>
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --" />
</activity>

<provider
Expand All @@ -117,7 +93,7 @@
android:exported="false"
android:grantUriPermissions="true"
>
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" >
</meta-data>
</provider>

Expand Down
27 changes: 10 additions & 17 deletions cmake_templates/build.gradle.in
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
/* keep in sync with /opt/Qt/<ver>/android//src/android/templates/build.gradle */
/* keep in sync with /opt/Qt/<ver>/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'
}
}

Expand All @@ -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 {
Expand All @@ -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@'
Expand Down
Loading