From 23be48157f5c09578de2bb76d346b4f5902df6f6 Mon Sep 17 00:00:00 2001 From: JongChern Date: Thu, 5 Dec 2024 15:50:31 +0800 Subject: [PATCH 1/5] able to build now --- .../build.gradle | 18 +++++++++++------- .../com/shimmerresearch/android/Shimmer.java | 2 +- .../androidradiodriver/Shimmer3BLEAndroid.java | 2 +- .../bluetoothManagerExample/build.gradle | 2 +- ShimmerAndroidInstrumentDriver/build.gradle | 9 +++++---- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../shimmer3DOrientationExample/build.gradle | 12 ++++++------ .../shimmerBasicExample/build.gradle | 2 +- .../shimmerLegacyExample/build.gradle | 2 +- .../shimmerServiceExample/build.gradle | 2 +- 10 files changed, 29 insertions(+), 24 deletions(-) diff --git a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/build.gradle b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/build.gradle index 3f1ab1b0..f10d0dbb 100644 --- a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/build.gradle +++ b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/build.gradle @@ -1,7 +1,7 @@ //JC: use gradlew install and then comment out install and use gradlew bintray apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' +//apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'maven-publish' android { @@ -51,6 +51,10 @@ android { preDexLibraries = false jumboMode = true } + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } } @@ -97,11 +101,11 @@ publishing { } */ dependencies { - compile 'com.google.guava:guava:20.0' - compile 'java3d:vecmath:1.3.1' - compile files('libs/ShimmerBiophysicalProcessingLibrary_Rev_0_11.jar') - compile files('libs/AndroidBluetoothLibrary.jar') - compile files('libs/androidplot-core-0.5.0-release.jar') - compile 'com.android.support:appcompat-v7:26.1.0' + implementation 'com.google.guava:guava:20.0' + implementation 'java3d:vecmath:1.3.1' + implementation files('libs/ShimmerBiophysicalProcessingLibrary_Rev_0_11.jar') + implementation files('libs/AndroidBluetoothLibrary.jar') + api files('libs/androidplot-core-0.5.0-release.jar') + implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.github.Jasonchenlijian:FastBle:2.4.0' } diff --git a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/main/java/com/shimmerresearch/android/Shimmer.java b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/main/java/com/shimmerresearch/android/Shimmer.java index 9c647cbc..08c5347c 100644 --- a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/main/java/com/shimmerresearch/android/Shimmer.java +++ b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/main/java/com/shimmerresearch/android/Shimmer.java @@ -1772,7 +1772,7 @@ protected void interpretDataPacketFormat(Object object, @Override public void createConfigBytesLayout() { //TODO check this is ok - mConfigByteLayout = new ConfigByteLayoutShimmer3(getFirmwareIdentifier(), getFirmwareVersionMajor(), getFirmwareVersionMinor(), getFirmwareVersionInternal()); + mConfigByteLayout = new ConfigByteLayoutShimmer3(getFirmwareIdentifier(), getFirmwareVersionMajor(), getFirmwareVersionMinor(), getFirmwareVersionInternal(), getHardwareVersion()); } protected void finishOperation(BT_STATE currentOperation) { diff --git a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/main/java/com/shimmerresearch/androidradiodriver/Shimmer3BLEAndroid.java b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/main/java/com/shimmerresearch/androidradiodriver/Shimmer3BLEAndroid.java index 2785d85d..6e161763 100644 --- a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/main/java/com/shimmerresearch/androidradiodriver/Shimmer3BLEAndroid.java +++ b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/main/java/com/shimmerresearch/androidradiodriver/Shimmer3BLEAndroid.java @@ -457,7 +457,7 @@ protected void interpretDataPacketFormat(Object o, Configuration.COMMUNICATION_T @Override public void createConfigBytesLayout() { - mConfigByteLayout = new ConfigByteLayoutShimmer3(getFirmwareIdentifier(), getFirmwareVersionMajor(), getFirmwareVersionMinor(), getFirmwareVersionInternal()); + mConfigByteLayout = new ConfigByteLayoutShimmer3(getFirmwareIdentifier(), getFirmwareVersionMajor(), getFirmwareVersionMinor(), getFirmwareVersionInternal(), getHardwareVersion()); } @Override diff --git a/ShimmerAndroidInstrumentDriver/bluetoothManagerExample/build.gradle b/ShimmerAndroidInstrumentDriver/bluetoothManagerExample/build.gradle index 9918e5ea..6cbc3d63 100644 --- a/ShimmerAndroidInstrumentDriver/bluetoothManagerExample/build.gradle +++ b/ShimmerAndroidInstrumentDriver/bluetoothManagerExample/build.gradle @@ -50,7 +50,7 @@ android { dependencies { implementation project(':ShimmerAndroidInstrumentDriver') implementation fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + androidTestImplementation ('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) implementation 'com.android.support.constraint:constraint-layout:1.0.2' diff --git a/ShimmerAndroidInstrumentDriver/build.gradle b/ShimmerAndroidInstrumentDriver/build.gradle index c4dfa732..7b1de9f0 100644 --- a/ShimmerAndroidInstrumentDriver/build.gradle +++ b/ShimmerAndroidInstrumentDriver/build.gradle @@ -1,14 +1,15 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.10' + ext.kotlin_version = '1.3.40' repositories { google() mavenCentral() mavenLocal() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.4' + //classpath 'com.android.tools.build:gradle:3.5.4' + classpath 'com.android.tools.build:gradle:7.0.4' // Compatible with JDK 11 classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" //classpath('org.jfrog.buildinfo:build-info-extractor-gradle:4.21.0') @@ -77,7 +78,7 @@ allprojects { implementation 'java3d:vecmath:1.3.1' implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.github.Jasonchenlijian:FastBle:2.4.0' - implementation (group: 'com.shimmerresearch', name: 'shimmerbluetoothmanager', version:'0.10.18_alpha'){ + implementation (group: 'com.shimmerresearch', name: 'shimmerbluetoothmanagerdev', version:'0.10.22_alpha'){ // excluding org.json which is provided by Android exclude group: 'io.netty' @@ -85,7 +86,7 @@ allprojects { exclude group: 'org.apache.commons.math' } - implementation (group: 'com.shimmerresearch', name: 'shimmerdriver', version:'0.10.18_alpha'){ + implementation (group: 'com.shimmerresearch', name: 'shimmerdriverdev', version:'0.10.22_alpha'){ // excluding org.json which is provided by Android exclude group: 'io.netty' diff --git a/ShimmerAndroidInstrumentDriver/gradle/wrapper/gradle-wrapper.properties b/ShimmerAndroidInstrumentDriver/gradle/wrapper/gradle-wrapper.properties index 64741c67..3542b438 100644 --- a/ShimmerAndroidInstrumentDriver/gradle/wrapper/gradle-wrapper.properties +++ b/ShimmerAndroidInstrumentDriver/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip diff --git a/ShimmerAndroidInstrumentDriver/shimmer3DOrientationExample/build.gradle b/ShimmerAndroidInstrumentDriver/shimmer3DOrientationExample/build.gradle index c8148e05..4302b9a9 100644 --- a/ShimmerAndroidInstrumentDriver/shimmer3DOrientationExample/build.gradle +++ b/ShimmerAndroidInstrumentDriver/shimmer3DOrientationExample/build.gradle @@ -35,10 +35,10 @@ android { } dependencies { - compile project(':ShimmerAndroidInstrumentDriver') - compile 'org.apache.commons:commons-math:2.2' - compile 'org.apache.commons:commons-lang3:3.4' - provided files('../ShimmerAndroidInstrumentDriver/libs/ShimmerBiophysicalProcessingLibrary_Rev_0_11.jar') - provided files('../ShimmerAndroidInstrumentDriver/libs/androidplot-core-0.5.0-release.jar') - provided 'com.google.guava:guava:19.0' + implementation project(':ShimmerAndroidInstrumentDriver') + implementation 'org.apache.commons:commons-math:2.2' + implementation 'org.apache.commons:commons-lang3:3.4' + implementation files('../ShimmerAndroidInstrumentDriver/libs/ShimmerBiophysicalProcessingLibrary_Rev_0_11.jar') + implementation files('../ShimmerAndroidInstrumentDriver/libs/androidplot-core-0.5.0-release.jar') + implementation 'com.google.guava:guava:19.0' } \ No newline at end of file diff --git a/ShimmerAndroidInstrumentDriver/shimmerBasicExample/build.gradle b/ShimmerAndroidInstrumentDriver/shimmerBasicExample/build.gradle index 5e32a060..3490aca8 100644 --- a/ShimmerAndroidInstrumentDriver/shimmerBasicExample/build.gradle +++ b/ShimmerAndroidInstrumentDriver/shimmerBasicExample/build.gradle @@ -50,7 +50,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:support-v4:+' androidTestImplementation 'com.android.support:support-annotations:25.3.1' - compile(group: 'com.shimmerresearch', name: 'shimmerandroidinstrumentdriver', version: '3.0.85_beta', ext: 'aar') + implementation(group: 'com.shimmerresearch', name: 'shimmerandroidinstrumentdriver', version: '3.0.85_beta', ext: 'aar') implementation 'com.android.support.constraint:constraint-layout:1.0.2' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' diff --git a/ShimmerAndroidInstrumentDriver/shimmerLegacyExample/build.gradle b/ShimmerAndroidInstrumentDriver/shimmerLegacyExample/build.gradle index f82eac11..b9e55b4e 100644 --- a/ShimmerAndroidInstrumentDriver/shimmerLegacyExample/build.gradle +++ b/ShimmerAndroidInstrumentDriver/shimmerLegacyExample/build.gradle @@ -48,7 +48,7 @@ android { dependencies { implementation project(':ShimmerAndroidInstrumentDriver') implementation fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) implementation 'com.android.support.constraint:constraint-layout:1.0.2' diff --git a/ShimmerAndroidInstrumentDriver/shimmerServiceExample/build.gradle b/ShimmerAndroidInstrumentDriver/shimmerServiceExample/build.gradle index 613b5414..92142fb8 100644 --- a/ShimmerAndroidInstrumentDriver/shimmerServiceExample/build.gradle +++ b/ShimmerAndroidInstrumentDriver/shimmerServiceExample/build.gradle @@ -48,7 +48,7 @@ android { dependencies { implementation project(':ShimmerAndroidInstrumentDriver') implementation fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) implementation 'com.android.support.constraint:constraint-layout:1.0.2' From 55282308537d3943f79f47a0a4c64e2646fe2532 Mon Sep 17 00:00:00 2001 From: JongChern Date: Thu, 5 Dec 2024 16:39:41 +0800 Subject: [PATCH 2/5] Update ShimmerBluetoothManagerAndroid.java --- .../android/manager/ShimmerBluetoothManagerAndroid.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/main/java/com/shimmerresearch/android/manager/ShimmerBluetoothManagerAndroid.java b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/main/java/com/shimmerresearch/android/manager/ShimmerBluetoothManagerAndroid.java index 35630142..14c238c2 100644 --- a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/main/java/com/shimmerresearch/android/manager/ShimmerBluetoothManagerAndroid.java +++ b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/main/java/com/shimmerresearch/android/manager/ShimmerBluetoothManagerAndroid.java @@ -396,7 +396,7 @@ protected ShimmerDevice createNewShimmer3(ShimmerRadioInitializer shimmerRadioIn mMapOfBtConnectedShimmers.put(bluetoothAddress, shimmer); try { ShimmerVerObject sVO = shimmerRadioInitializer.readShimmerVerObject(); - if (sVO.isShimmerGen3()) { + if (sVO.isShimmerGen3() || sVO.isShimmerGen3R()) { return initializeShimmer3(serialPort, shimmer); } else if (sVO.isShimmerGen2()) { return initializeShimmer2r(serialPort, shimmer); From f5eab279a3d38ba865f0ecafee93dfc08d79f335 Mon Sep 17 00:00:00 2001 From: JongChern Date: Fri, 27 Dec 2024 13:19:29 +0800 Subject: [PATCH 3/5] minor fix --- ShimmerAndroidInstrumentDriver/build.gradle | 4 ++-- .../shimmerresearch/shimmerserviceexample/MainActivity.java | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ShimmerAndroidInstrumentDriver/build.gradle b/ShimmerAndroidInstrumentDriver/build.gradle index 7b1de9f0..d1c73736 100644 --- a/ShimmerAndroidInstrumentDriver/build.gradle +++ b/ShimmerAndroidInstrumentDriver/build.gradle @@ -78,7 +78,7 @@ allprojects { implementation 'java3d:vecmath:1.3.1' implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.github.Jasonchenlijian:FastBle:2.4.0' - implementation (group: 'com.shimmerresearch', name: 'shimmerbluetoothmanagerdev', version:'0.10.22_alpha'){ + implementation (group: 'com.shimmerresearch', name: 'shimmerbluetoothmanagerdev', version:'0.10.25_alpha'){ // excluding org.json which is provided by Android exclude group: 'io.netty' @@ -86,7 +86,7 @@ allprojects { exclude group: 'org.apache.commons.math' } - implementation (group: 'com.shimmerresearch', name: 'shimmerdriverdev', version:'0.10.22_alpha'){ + implementation (group: 'com.shimmerresearch', name: 'shimmerdriverdev', version:'0.10.25_alpha'){ // excluding org.json which is provided by Android exclude group: 'io.netty' diff --git a/ShimmerAndroidInstrumentDriver/shimmerServiceExample/src/main/java/com/shimmerresearch/shimmerserviceexample/MainActivity.java b/ShimmerAndroidInstrumentDriver/shimmerServiceExample/src/main/java/com/shimmerresearch/shimmerserviceexample/MainActivity.java index 89fa253a..3bd0a919 100644 --- a/ShimmerAndroidInstrumentDriver/shimmerServiceExample/src/main/java/com/shimmerresearch/shimmerserviceexample/MainActivity.java +++ b/ShimmerAndroidInstrumentDriver/shimmerServiceExample/src/main/java/com/shimmerresearch/shimmerserviceexample/MainActivity.java @@ -684,6 +684,9 @@ else if(msg.what == Shimmer.MSG_IDENTIFIER_SYNC_PROGRESS){ else if(msg.what == Shimmer.MSG_IDENTIFIER_NOTIFICATION_MESSAGE){ if(((CallbackObject)msg.obj).mIndicator == Shimmer.NOTIFICATION_SHIMMER_FULLY_INITIALIZED){ Toast.makeText(getApplicationContext(), "Device fully initialized: ", Toast.LENGTH_SHORT).show(); + String macAddress = ((CallbackObject)msg.obj).mBluetoothAddress; + ShimmerDevice device = mService.getShimmer(macAddress); + deviceConfigFragment.buildDeviceConfigList(device, MainActivity.this, mService.getBluetoothManager()); } } From e39a67c440b77ae4834487a09f74a1521a1f7103 Mon Sep 17 00:00:00 2001 From: JongChern Date: Fri, 27 Dec 2024 15:32:55 +0800 Subject: [PATCH 4/5] Update gradle-wrapper.properties --- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/gradle/wrapper/gradle-wrapper.properties b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/gradle/wrapper/gradle-wrapper.properties index 8d29cdfb..ad5e98c9 100644 --- a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/gradle/wrapper/gradle-wrapper.properties +++ b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip From 0574501f16ef43d57ca06d5c1bdf3f9fc36da5d5 Mon Sep 17 00:00:00 2001 From: JongChern Date: Fri, 27 Dec 2024 15:38:38 +0800 Subject: [PATCH 5/5] Update build.gradle fix for basic example --- ShimmerAndroidInstrumentDriver/shimmerBasicExample/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShimmerAndroidInstrumentDriver/shimmerBasicExample/build.gradle b/ShimmerAndroidInstrumentDriver/shimmerBasicExample/build.gradle index 3490aca8..27ca4062 100644 --- a/ShimmerAndroidInstrumentDriver/shimmerBasicExample/build.gradle +++ b/ShimmerAndroidInstrumentDriver/shimmerBasicExample/build.gradle @@ -50,7 +50,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:support-v4:+' androidTestImplementation 'com.android.support:support-annotations:25.3.1' - implementation(group: 'com.shimmerresearch', name: 'shimmerandroidinstrumentdriver', version: '3.0.85_beta', ext: 'aar') + implementation(group: 'com.shimmerresearch', name: 'shimmerandroidinstrumentdriver', version: '3.0.87_alpha', ext: 'aar') implementation 'com.android.support.constraint:constraint-layout:1.0.2' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1'