Skip to content

Commit 5414b67

Browse files
committed
Update gradle, dependencies, NDK, buildTools, Java, compileSdk, and liblsl (1.16.2) to last versions. Rename sample app
1 parent e48402f commit 5414b67

File tree

2,146 files changed

+270
-136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,146 files changed

+270
-136
lines changed

.gitignore

100644100755
File mode changed.

LICENSE

100644100755
File mode changed.

README.md

100644100755
File mode changed.

app/.gitignore

100644100755
File mode changed.

app/build.gradle

100644100755
Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
//
22
// Uncomment the blocks "externalNativeBuild" for building the app with liblsl (LSL) from the source
3-
// code using CMake. Make sure you have liblsl's source code
3+
// code. Make sure you have liblsl's source code
44
// (https://github.com/sccn/liblsl/releases/latest -> Source code) on /app-root/liblsl or the path
55
// you specified on the block "externalNativeBuild.cmake" -> path "./liblsl-path/CMakeLists.txt"
6+
67
//
7-
// In case of an external CMake installation (https://cmake.org/download/ -> Binary distributions),
8-
// specify cmake.dir=path on local.properties, e.g. cmake.dir=/home/user/Android/SDK/cmake/3.18.0
9-
// Otherwise you can install CMake using Android Studio's menu via Tools -> SDK Manager -> SDK Tools
10-
// In case of external CMake installation, you will need the Ninja binary inside your cmake/bin
11-
// folder to make the build work: https://github.com/ninja-build/ninja/releases/latest
12-
//
13-
// Comment the "externalNativeBuild" blocks for building the app using the compiled library
8+
// Comment the "externalNativeBuild" blocks for building the app using the compiled native library
149
// (liblsl.so). Once the build succeeds, the library files (.so) are automatically copied inside
1510
// the folders:
1611
// /project-root/app/src/debug/jniLibs (for a debug build)
1712
// /project-root/app/src/main/jniLibs (for a release build)
13+
// Note: A backup of these prebuilt native libraries is on /project-root/libs/[debug/release]
14+
//
1815
// IMPORTANT to use LSL on your code:
1916
// - Take the the last version of LSL.java:
2017
// https://github.com/labstreaminglayer/liblsl-Java/blob/master/src/edu/ucsd/sccn/LSL.java
@@ -23,7 +20,7 @@
2320
// - Include the following permission on your AndroidManifest.xml:
2421
// <uses-permission android:name="android.permission.INTERNET" />
2522
// - Include the jna (Java Native Access) in your dependencies block. E.g.:
26-
// implementation 'net.java.dev.jna:jna:5.10.0@aar'
23+
// implementation 'net.java.dev.jna:jna:[latest-version]@aar'
2724
//
2825

2926
apply plugin: 'com.android.application'
@@ -46,25 +43,24 @@ android {
4643
keyPassword keystoreProperties['keyPassword']
4744
}
4845
}
49-
compileSdk 31
46+
compileSdk 33
5047
defaultConfig {
5148
minSdk 24
52-
targetSdk 31
5349
versionCode 1
54-
versionName '1.16.0'
55-
setProperty('archivesBaseName', "liblsl-android-builder-$versionName")
50+
versionName '1.16.2'
51+
setProperty('archivesBaseName', "LSLMarkersSenderExample-$versionName")
5652
ndk {
5753
// Specifies the ABI configurations of your native
5854
// libraries Gradle should build and package with your app.
5955
abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
6056
}
6157
// externalNativeBuild.cmake {
62-
// arguments "-DANDROID_CPP_FEATURES=rtti exceptions", "-DLSL_NO_FANCY_LIBNAME=1", "-DANDROID_PLATFORM=24"
58+
// arguments "-DANDROID_CPP_FEATURES=rtti exceptions", "-DANDROID_PLATFORM=24"
6359
// targets "lsl"
6460
// }
6561
}
6662
// externalNativeBuild.cmake {
67-
// path "./liblsl/CMakeLists.txt"
63+
// path "../liblsl/CMakeLists.txt"
6864
// }
6965
buildTypes {
7066
debug {
@@ -84,8 +80,8 @@ android {
8480
}
8581
}
8682
compileOptions {
87-
sourceCompatibility JavaVersion.VERSION_1_8
88-
targetCompatibility JavaVersion.VERSION_1_8
83+
sourceCompatibility JavaVersion.VERSION_11
84+
targetCompatibility JavaVersion.VERSION_11
8985
}
9086
packagingOptions {
9187
jniLibs {
@@ -95,30 +91,47 @@ android {
9591
pickFirsts += ['**/lib/**']
9692
}
9793
}
98-
buildToolsVersion '32.0.0'
99-
ndkVersion '23.1.7779620'
94+
buildToolsVersion = '34.0.0'
95+
ndkVersion '25.2.9519653'
96+
namespace 'liblsl.android.builder'
10097
}
10198

10299
dependencies {
103-
implementation 'androidx.appcompat:appcompat:1.4.1'
104-
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
105-
implementation 'com.google.android.material:material:1.5.0'
106-
implementation 'net.java.dev.jna:jna:5.11.0@aar'
100+
implementation 'androidx.appcompat:appcompat:1.6.1'
101+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
102+
implementation 'com.google.android.material:material:1.9.0'
103+
implementation 'net.java.dev.jna:jna:5.13.0@aar'
107104
}
108105

109106
// copy native libraries to per project location
110-
task copyDebugJniLibs(type: Copy) {
111-
from 'build/intermediates/cmake/debug/obj'
107+
tasks.register('copyDebugJniLibs', Copy) {
108+
from '../app/build/intermediates/merged_native_libs/debug/out/lib'
109+
into '../app/src/debug/jniLibs'
110+
include('**/*.*')
111+
exclude 'mips*', 'armeabi'
112+
}
113+
tasks.register('copyReleaseJniLibs', Copy) {
114+
from '../app/build/intermediates/stripped_native_libs/release/out/lib'
115+
into '../app/src/main/jniLibs'
116+
include('**/*.*')
117+
exclude 'mips*', 'armeabi'
118+
}
119+
120+
// backup native libraries to per project location
121+
tasks.register('backupDebugJniLibs', Copy) {
122+
from '../app/src/debug/jniLibs'
123+
into '../libs/debug'
112124
include('**/*.*')
113-
into 'src/debug/jniLibs'
114125
}
115-
task copyReleaseJniLibs(type: Copy) {
116-
from 'build/intermediates/cmake/release/obj'
126+
tasks.register('backupReleaseJniLibs', Copy) {
127+
from '../app/src/main/jniLibs'
128+
into '../libs/release'
117129
include('**/*.*')
118-
into 'src/main/jniLibs'
119130
}
120131

121-
tasks.whenTaskAdded { task ->
132+
tasks.configureEach { task ->
122133
if (task.name == 'assembleDebug') task.finalizedBy('copyDebugJniLibs')
123134
if (task.name == 'assembleRelease') task.finalizedBy('copyReleaseJniLibs')
135+
if (task.name == 'copyDebugJniLibs') task.finalizedBy('backupDebugJniLibs')
136+
if (task.name == 'copyReleaseJniLibs') task.finalizedBy('backupReleaseJniLibs')
124137
}

app/consumer-rules.pro

100644100755
File mode changed.

app/debug/output-metadata.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"version": 3,
3+
"artifactType": {
4+
"type": "APK",
5+
"kind": "Directory"
6+
},
7+
"applicationId": "liblsl.android.builder",
8+
"variantName": "debug",
9+
"elements": [
10+
{
11+
"type": "SINGLE",
12+
"filters": [],
13+
"attributes": [],
14+
"versionCode": 1,
15+
"versionName": "1.16.2",
16+
"outputFile": "LSLMarkersSenderExample-1.16.2-debug.apk"
17+
}
18+
],
19+
"elementType": "File"
20+
}

app/key.jks

100644100755
File mode changed.

app/proguard-rules.pro

100644100755
File mode changed.

app/release/output-metadata.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"version": 3,
3+
"artifactType": {
4+
"type": "APK",
5+
"kind": "Directory"
6+
},
7+
"applicationId": "liblsl.android.builder",
8+
"variantName": "release",
9+
"elements": [
10+
{
11+
"type": "SINGLE",
12+
"filters": [],
13+
"attributes": [],
14+
"versionCode": 1,
15+
"versionName": "1.16.2",
16+
"outputFile": "LSLMarkersSenderExample-1.16.2-release.apk"
17+
}
18+
],
19+
"elementType": "File"
20+
}

0 commit comments

Comments
 (0)