Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
    Bump version number
    Separate debug and release build for dev and master branch, sign builds on master branch
    Add missing files in lslboost
    Fix incorrect indexing when selecting the TextView to update the quality indicators of (did not consider effects of scrolling)
  • Loading branch information
pmaanen committed Dec 11, 2023
1 parent c071cef commit 09f68f4
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 22 deletions.
59 changes: 54 additions & 5 deletions .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,46 @@ on:
- master # Change this to your main branch name (e.g., master)
- dev
jobs:
build:
build-debug:
name: Build debug
runs-on: ubuntu-latest
if: github.ref =='refs/heads/dev'
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/gradle-build-action@v2
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: Build debug APK
run: ./gradlew assembleDebug

- name: Upload APK artifact
uses: actions/upload-artifact@v2
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
Expand All @@ -32,11 +69,23 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew

- name: Build APK
run: ./gradlew assembleDebug # Change 'assembleDebug' to 'assembleRelease' if you want a release build
- name: Build debug APK
run: ./gradlew assembleRelease

- name: Sign app APK
uses: r0adkll/sign-android-release@v1
# ID used to access action output
id: sign_app
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.SIGNING_KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}

- name: Upload APK artifact
uses: actions/upload-artifact@v2
with:
name: app-debug # Change this to your desired artifact name
path: ./app/build/outputs/apk/debug/LSLRecorder-1.0.0-debug.apk
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

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.uol.neuropsy.LSLReceiver"
minSdkVersion 26
targetSdkVersion 31
versionCode 3 // increment with every release
versionName '1.2' // change with every release
versionCode 4 // increment with every release
versionName '1.3' // change with every release
setProperty("archivesBaseName", "RECORDA-$versionName")
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
Expand Down
29 changes: 14 additions & 15 deletions app/src/main/java/de/uol/neuropsy/recorda/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -327,26 +327,25 @@ private void updateStreamQualityIndicators() {
if (!isRunning || lsl == null) {
return;
}
ArrayAdapter<StreamName> adapter = (ArrayAdapter<StreamName>) lv.getAdapter();
for (int i = 0; i < adapter.getCount(); i++) {
StreamName stream = adapter.getItem(i);
for (int i = lv.getFirstVisiblePosition(); i <= lv.getLastVisiblePosition(); i++) {
StreamName stream = (StreamName) lv.getItemAtPosition(i);
if (stream == null) {
Log.w(TAG, "Unexpected: No data item at position " + i);
continue;
}
QualityState quality = lsl.getCurrentStreamQuality(stream.lslName);
if (quality == null) {
continue; // that stream is not being recorded
}
if (i < lv.getFirstVisiblePosition() || i > lv.getLastVisiblePosition()) {
Log.d("RECORDA", stream.lslName + " not visible, skipping");
return;
}
TextView listItem = (TextView) lv.getChildAt(i);
if (listItem == null)
Log.e("RECORDA", "Could not find child: " + stream.lslName + " with id: " + i);
else {
Log.e("RECORDA", "Setting quality for: " + stream.lslName + " with id: " + i);
setColorBasedOnQuality(listItem, quality);
double currentSamplingRate = lsl.getCurrentSamplingRate(stream.lslName);
setTextBasedOnSamplingRate(listItem, stream, currentSamplingRate);
TextView listItem = (TextView) lv.getChildAt(i - lv.getFirstVisiblePosition());
if (listItem == null) {
Log.w(TAG, "Unexpected: No view at index " + i);
continue;
}
Log.i(TAG,"Trying to set stream quality for "+stream.lslName+" got:"+listItem.getText());
setColorBasedOnQuality(listItem, quality);
double currentSamplingRate = lsl.getCurrentSamplingRate(stream.lslName);
setTextBasedOnSamplingRate(listItem, stream, currentSamplingRate);
}
}

Expand Down
31 changes: 31 additions & 0 deletions liblsl/lslboost/boost/tti/gen/has_member_function_gen.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

// (C) Copyright Edward Diener 2011,2012
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).

#if !defined(BOOST_TTI_MEMBER_FUNCTION_GEN_HPP)
#define BOOST_TTI_MEMBER_FUNCTION_GEN_HPP

#include <boost/preprocessor/cat.hpp>

/*
The succeeding comments in this file are in doxygen format.
*/

/** \file
*/

/// Generates the macro metafunction name for BOOST_TTI_HAS_MEMBER_FUNCTION.
/**
name = the name of the member function.
returns = the generated macro metafunction name.
*/
#define BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(name) \
BOOST_PP_CAT(has_member_function_,name) \
/**/

#endif // BOOST_TTI_MEMBER_FUNCTION_GEN_HPP
25 changes: 25 additions & 0 deletions liblsl/lslboost/boost/tti/gen/namespace_gen.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

// (C) Copyright Edward Diener 2011,2012
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).

#if !defined(BOOST_TTI_NAMESPACE_GEN_HPP)
#define BOOST_TTI_NAMESPACE_GEN_HPP

/*
The succeeding comments in this file are in doxygen format.
*/

/** \file
*/

/// Generates the name of the Boost TTI namespace
/**
returns = the generated name of the Boost TTI namespace.
*/
#define BOOST_TTI_NAMESPACE lslboost::tti

#endif // BOOST_TTI_NAMESPACE_GEN_HPP

0 comments on commit 09f68f4

Please sign in to comment.