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
40 changes: 11 additions & 29 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,14 @@ jobs:
with:
submodules: 'recursive'

- name: Install Qt
uses: jurplel/install-qt-action@v4
- name: Install Java
uses: actions/setup-java@v5
with:
aqtversion: '==3.3.*'
version: '5.14.2'
host: 'linux'
target: 'android'
arch: 'android'
distribution: 'jetbrains'
java-version: '25'

- name: Install SDK
run: ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install 'platforms;android-31' 'build-tools;31.0.0' 'ndk;21.3.6528147'
run: ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install 'platforms;android-36' 'build-tools;36.1.0' 'ndk;28.2.13676358'

# Secrets should be the base64 portion of the PEM format
# (i.e. the stuff between the BEGIN/END lines):
Expand Down Expand Up @@ -71,36 +68,21 @@ jobs:
# be signed with debug keys.

- name: Build Android package
working-directory: Desktop_Interface
working-directory: Android_App
run: |
export ANDROID_NDK_ROOT="${ANDROID_SDK_ROOT}/ndk/21.3.6528147"
APK_BASENAME="Labrador-$(git rev-parse --short HEAD)"
if [ -e cert.cer ] && [ -e cert.p8 ]; then
qmake -config release
make -j$(nproc)
make INSTALL_ROOT=android-build install
JAVA_HOME=${JAVA_HOME_8_X64} androiddeployqt --input android-Labrador-deployment-settings.json --output android-build --aab --android-platform android-31 --verbose --gradle --release
${ANDROID_SDK_ROOT}/build-tools/31.0.0/apksigner sign --in android-build/build/outputs/apk/release/android-build-release-unsigned.apk --out ${APK_BASENAME}-release-signed.apk --key cert.p8 --cert cert.cer --verbose
./gradlew assembleRelease
${ANDROID_SDK_ROOT}/build-tools/36.1.0/apksigner sign --in app/build/outputs/apk/release/app-release-unsigned.apk --out ${APK_BASENAME}-release-signed.apk --key cert.p8 --cert cert.cer --verbose
else
qmake -config debug
make -j$(nproc)
make INSTALL_ROOT=android-build install
JAVA_HOME=${JAVA_HOME_8_X64} androiddeployqt --input android-Labrador-deployment-settings.json --output android-build --aab --android-platform android-31 --verbose --gradle
cp android-build/build/outputs/apk/debug/android-build-debug.apk ${APK_BASENAME}-debug.apk
./gradlew assembleDebug
cp app/build/outputs/apk/debug/app-debug.apk ${APK_BASENAME}-debug.apk
fi
cp android-build/build/outputs/bundle/release/android-build-release.aab ${APK_BASENAME}-release-unsigned.aab

- name: Upload apk artifacts
uses: actions/upload-artifact@v4
with:
name: asset-apk
path: Desktop_Interface/Labrador*.apk
compression-level: 0
if-no-files-found: error
- name: Upload aab artifacts
uses: actions/upload-artifact@v4
with:
name: asset-aab
path: Desktop_Interface/Labrador*.aab
path: Android_App/Labrador*.apk
compression-level: 0
if-no-files-found: error
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
[submodule "libdfuprog/dfu-programmer"]
path = libdfuprog/dfu-programmer
url = https://github.com/dfu-programmer/dfu-programmer
[submodule "Android_App/app/src/main/cpp/deps/implot"]
path = Android_App/app/src/main/cpp/deps/implot
url = https://github.com/brentfpage/implot.git
branch = for_labrador_android_app
[submodule "Android_App/app/src/main/cpp/deps/imgui"]
path = Android_App/app/src/main/cpp/deps/imgui
url = https://github.com/brentfpage/imgui.git
branch = for_labrador_android_app
[submodule "Android_App/app/src/main/cpp/deps/SDL"]
path = Android_App/app/src/main/cpp/deps/SDL
url = https://github.com/brentfpage/SDL.git
branch = for_labrador_app
Binary file added Android_App/.unpackaged_assets/labrador_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions Android_App/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
plugins {
alias(libs.plugins.android.application)
}

android {
namespace = "com.EspoTek.Labrador"
compileSdk {
version = release(36)
}

defaultConfig {
applicationId = "com.EspoTek.Labrador"
minSdk = 25
targetSdk = 36
versionCode = 1
versionName = "1.0"
ndk {
abiFilters.add("arm64-v8a")
abiFilters.add("armeabi-v7a")
}
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
externalNativeBuild {
cmake {
path = file("src/main/cpp/CMakeLists.txt")
version = "3.22.1"
}
}
sourceSets {
getByName("main") {
java {
directories.add("src/main/cpp/deps/SDL/android-project/app/src/main/java")
}
}
}
aaptOptions{
ignoreAssetsPattern = "!pulse.svg:!svg(2)-converted.svg:!settings-gear-svgrepo-com.svg:!mm.svg:!Greek_uc_delta.svg:!Readme.txt";
}
}

dependencies {
implementation("com.google.android.material:material:1.2.1")
implementation("com.android.support.constraint:constraint-layout:1.0.2")
implementation("androidx.appcompat:appcompat:1.7.1")
// implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
//implementation("androidx.appcompat:appcompat:1.0.2")
}
21 changes: 21 additions & 0 deletions Android_App/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
28 changes: 28 additions & 0 deletions Android_App/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-feature android:glEsVersion="0x00030000" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:enableOnBackInvokedCallback="false"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
<activity android:name="MainActivity" android:launchMode="singleTop"
android:configChanges="layoutDirection|locale|grammaticalGender|fontScale|fontWeightAdjustment|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/>
</intent-filter>

<!-- specify the usb device that should cause the app to open -->
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" android:resource="@xml/device_filter"/>

</activity>
</application>
</manifest>
Loading
Loading