Skip to content

Commit

Permalink
Update Android Source Package
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Apr 10, 2024
1 parent fdb5b55 commit 368dab2
Show file tree
Hide file tree
Showing 16 changed files with 438 additions and 100 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/android_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ jobs:

- run: sudo apt update

- name: Setup Java environment
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
Expand Down Expand Up @@ -118,10 +124,6 @@ jobs:
mkdir gstreamer-1.0-android-universal-1.18.5
tar xf gstreamer-1.0-android-universal-1.18.5.tar.xz -C gstreamer-1.0-android-universal-1.18.5
- name: Update android manifest
if: github.ref_name != 'Stable'
run: ${SOURCE_DIR}/tools/update_android_manifest_package.sh ${{ github.ref_name }}

- name: Install dependencies
run: sudo apt-get install -y ninja-build

Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/android_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ jobs:

- run: sudo apt update

- name: Setup Java environment
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
Expand Down Expand Up @@ -96,11 +102,6 @@ jobs:
mkdir gstreamer-1.0-android-universal-1.18.5
tar xf gstreamer-1.0-android-universal-1.18.5.tar.xz -C gstreamer-1.0-android-universal-1.18.5
- name: Update android manifest
if: github.ref_name != 'Stable'
run: |
${SOURCE_DIR}/tools/update_android_manifest_package.sh ${{ github.ref_name }}
- name: Build
working-directory: ${{ runner.temp }}/shadow_build_dir
env:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ elseif(ANDROID)
PROPERTIES
QT_ANDROID_ABIS ${ANDROID_ABI}
QT_ANDROID_MIN_SDK_VERSION 26
QT_ANDROID_TARGET_SDK_VERSION 33
QT_ANDROID_TARGET_SDK_VERSION 34
QT_ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_SOURCE_DIR}/android
QT_ANDROID_VERSION_NAME ${APP_VERSION_STR}
# QT_ANDROID_VERSION_CODE 5.0
Expand Down
8 changes: 5 additions & 3 deletions android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.qtproject.example"
package="org.mavlink.qgroundcontrol"
android:installLocation="auto"

android:versionCode="-- %%INSERT_VERSION_CODE%% --"
android:versionName="-- %%INSERT_VERSION_NAME%% --">

Expand All @@ -22,7 +22,9 @@
android:requestLegacyExternalStorage="true"
android:allowBackup="true"
android:fullBackupOnly="false"
android:icon="@drawable/icon">
android:icon="@drawable/icon"
android:usesCleartextTraffic="true"
android:networkSecurityConfig="@xml/network_security_config">
<activity
android:name="org.mavlink.qgroundcontrol.QGCActivity"
android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density"
Expand Down
26 changes: 21 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.1'
classpath 'com.android.tools.build:gradle:8.3.1'
}
}

Expand All @@ -18,7 +18,7 @@ apply plugin: 'com.android.application'

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation 'androidx.core:core:1.10.1'
implementation 'androidx.core:core:1.12.0'
}

android {
Expand Down Expand Up @@ -60,8 +60,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

lintOptions {
Expand All @@ -75,8 +75,24 @@ android {

defaultConfig {
resConfig "en"
minSdkVersion 25
minSdkVersion qtMinSdkVersion
targetSdkVersion qtTargetSdkVersion
ndk.abiFilters = qtTargetAbiList.split(",")

namespace "org.mavlink.qgroundcontrol"
// versionCode = 1.0
// versionName = "1.0"

println "minSdkVersion: ${minSdkVersion}"
println "targetSdkVersion: ${targetSdkVersion}"
println "ndk.abiFilters: ${ndk.abiFilters}"
println "versionCode: ${versionCode}"
println "versionName: ${versionName}"
}

println "androidCompileSdkVersion: ${compileSdkVersion}"
println "androidBuildToolsVersion: ${buildToolsVersion}"
println "androidNdkVersion: ${ndkVersion}"
println "project.name: ${project.name}"
println "qtAndroidDir: ${qtAndroidDir}"
}
17 changes: 17 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Project-wide Gradle settings.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2500m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# Enable building projects in parallel
org.gradle.parallel=true

# Gradle caching allows reusing the build artifacts from a previous
# build with the same inputs. However, over time, the cache size will
# grow. Uncomment the following line to enable it.
#org.gradle.caching=true

# Allow AndroidX usage
android.useAndroidX=true
Binary file added android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 368dab2

Please sign in to comment.