From fd50f5959e7a8ae640e551752b20805682f93de8 Mon Sep 17 00:00:00 2001 From: Paul Maanen Date: Thu, 24 Apr 2025 14:05:40 +0200 Subject: [PATCH 01/13] Reduce code duplication in workflows, bump GH actions versions --- .github/workflows/android_build.yml | 85 +++++++++-------------------- 1 file changed, 27 insertions(+), 58 deletions(-) diff --git a/.github/workflows/android_build.yml b/.github/workflows/android_build.yml index fa1fe40b..80133121 100644 --- a/.github/workflows/android_build.yml +++ b/.github/workflows/android_build.yml @@ -3,78 +3,46 @@ name: Android Build on: push: branches: - - master # Change this to your main branch name (e.g., master) - - dev + - master + - development + jobs: - build-debug: - name: Build debug + build: runs-on: ubuntu-latest - if: github.ref =='refs/heads/dev' - steps: - - name: Checkout code - uses: actions/checkout@v2 + strategy: + matrix: + buildType: [debug, release] - - name: Setup JDK - uses: actions/setup-java@v3 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: distribution: temurin java-version: '17' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 - with: - gradle-version: 7.4.2 - - - name: Setup Android NDK - uses: nttld/setup-ndk@v1.2.0 - with: - ndk-version: r25c - - - name: Grant execute permission for gradlew - run: chmod +x ./gradlew + - uses: gradle/actions/setup-gradle@v4 + with: { gradle-version: 7.4.2 } + - uses: nttld/setup-ndk@v1.2.0 + with: { ndk-version: r25c } + - run: chmod +x ./gradlew - name: Build debug APK + if: ${{ matrix.buildType == 'debug' && github.ref_name == 'development' }} run: ./gradlew assembleDebug - - name: Upload APK artifact + - name: Upload debug APK + if: ${{ matrix.buildType == 'debug' && github.ref_name == 'development' }} uses: actions/upload-artifact@v4 with: - name: RECORDA-debug # Change this to your desired artifact name - path: ./app/build/outputs/apk/debug/*.apk - - build-master: - name: Build master - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup JDK - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: '17' # Change this to the required Java version for your Android project - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 - with: - gradle-version: 7.4.2 - - - name: Setup Android NDK - uses: nttld/setup-ndk@v1.2.0 - with: - ndk-version: r25c - - - name: Grant execute permission for gradlew - run: chmod +x ./gradlew + name: RECORDA-debug + path: app/build/outputs/apk/debug/*.apk - name: Build release APK + if: ${{ matrix.buildType == 'release' && github.ref_name == 'master' }} run: ./gradlew assembleRelease - name: Sign app APK + if: ${{ matrix.buildType == 'release' && github.ref_name == 'master' }} uses: r0adkll/sign-android-release@v1 - # ID used to access action output id: sign_app with: releaseDirectory: app/build/outputs/apk/release @@ -85,9 +53,10 @@ jobs: env: # override default build-tools version (33.0.0) -- optional BUILD_TOOLS_VERSION: "34.0.0" - - name: Upload APK artifact + + - name: Upload release APK + if: ${{ matrix.buildType == 'release' && github.ref_name == 'master' }} uses: actions/upload-artifact@v4 with: - name: RECORDA-release # Change this to your desired artifact name - path: ${{steps.sign_app.outputs.signedReleaseFile}} # Change the path to the location of your APK file - + name: RECORDA-release + path: ${{ steps.sign_app.outputs.signedReleaseFile }} From 52e330d7d59ec78e2e20061b72eb19d4b65831c9 Mon Sep 17 00:00:00 2001 From: Paul Maanen Date: Fri, 25 Apr 2025 14:10:25 +0200 Subject: [PATCH 02/13] Add in-app tutorial, fix compilations issues w/ legacy libs. In order to use the viewpager2 dependency, I needed to enable AndroidX, which in turn made it necessary to stop using some legacy UI dependencies. Now RECORDA has more or less the same dependencies (apart from libxdf and the Movella SDK) as SENDA, which makes future development and migration to Kotlin far easier. --- .idea/gradle.xml | 2 +- app/build.gradle | 14 +- app/src/main/AndroidManifest.xml | 6 + .../de/uol/neuropsy/recorda/LSLService.java | 7 +- .../de/uol/neuropsy/recorda/MainActivity.java | 473 ----------------- .../de/uol/neuropsy/recorda/MainActivity.kt | 479 ++++++++++++++++++ .../neuropsy/recorda/SettingsActivity.java | 6 +- .../uol/neuropsy/recorda/TutorialActivity.kt | 40 ++ .../neuropsy/recorda/TutorialPageFragment.kt | 54 ++ app/src/main/res/drawable/recorda_broken.png | Bin 0 -> 441913 bytes app/src/main/res/drawable/recorda_laggy.png | Bin 0 -> 459551 bytes app/src/main/res/drawable/recorda_main.png | Bin 0 -> 737170 bytes .../main/res/drawable/recorda_settings.png | Bin 0 -> 371109 bytes .../main/res/layout-land/activity_main.xml | 6 +- app/src/main/res/layout/activity_main.xml | 18 +- app/src/main/res/layout/activity_tutorial.xml | 17 + .../main/res/layout/close_tutorial_button.xml | 10 + app/src/main/res/layout/settings_activity.xml | 4 +- app/src/main/res/layout/tutorial_end.xml | 52 ++ app/src/main/res/layout/tutorial_image.xml | 7 + .../main/res/layout/tutorial_page_default.xml | 12 + .../main/res/layout/tutorial_page_five.xml | 23 + .../main/res/layout/tutorial_page_four.xml | 28 + app/src/main/res/layout/tutorial_page_one.xml | 39 ++ .../main/res/layout/tutorial_page_three.xml | 28 + app/src/main/res/layout/tutorial_page_two.xml | 28 + app/src/main/res/values/strings.xml | 3 + build.gradle | 16 +- gradle.properties | 2 + liblsl-Java/build.gradle | 10 - settings.gradle | 27 +- 31 files changed, 882 insertions(+), 529 deletions(-) delete mode 100755 app/src/main/java/de/uol/neuropsy/recorda/MainActivity.java create mode 100755 app/src/main/java/de/uol/neuropsy/recorda/MainActivity.kt create mode 100644 app/src/main/java/de/uol/neuropsy/recorda/TutorialActivity.kt create mode 100644 app/src/main/java/de/uol/neuropsy/recorda/TutorialPageFragment.kt create mode 100644 app/src/main/res/drawable/recorda_broken.png create mode 100644 app/src/main/res/drawable/recorda_laggy.png create mode 100644 app/src/main/res/drawable/recorda_main.png create mode 100644 app/src/main/res/drawable/recorda_settings.png create mode 100644 app/src/main/res/layout/activity_tutorial.xml create mode 100644 app/src/main/res/layout/close_tutorial_button.xml create mode 100644 app/src/main/res/layout/tutorial_end.xml create mode 100644 app/src/main/res/layout/tutorial_image.xml create mode 100644 app/src/main/res/layout/tutorial_page_default.xml create mode 100644 app/src/main/res/layout/tutorial_page_five.xml create mode 100644 app/src/main/res/layout/tutorial_page_four.xml create mode 100644 app/src/main/res/layout/tutorial_page_one.xml create mode 100644 app/src/main/res/layout/tutorial_page_three.xml create mode 100644 app/src/main/res/layout/tutorial_page_two.xml diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 8dbfdc61..184d3ed8 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -7,7 +7,7 @@