Skip to content

Commit

Permalink
Update android example project and link with iconv (#423)
Browse files Browse the repository at this point in the history
IB-7131

Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma authored Aug 31, 2021
1 parent 99eb70d commit ccfe21c
Show file tree
Hide file tree
Showing 26 changed files with 49 additions and 2,617 deletions.
6 changes: 1 addition & 5 deletions examples/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@
1. Install dependencies see [README.md](../../README.md#macOS)
2. Build example and run

open project with Android Studio, build and run

Shared libraries must placed app/src/main/jniLibs/[armeabi-v7a,arm64-v8a,x86]/.
Also /Library/libdigidocpp.androidarm/etc/digidocpp/schema content should be ziped and included app/src/main/res/raw/schema.zip path.
It will be extracted on application execution and path given to library special digidoc.initializeLib(appName, path) JNI function.
./gradlew installDebug
31 changes: 17 additions & 14 deletions examples/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
apply plugin: 'com.android.application'

def libsPath = '/Library/libdigidocpp'

android {
compileSdkVersion 29
compileSdkVersion 30
defaultConfig {
applicationId "ee.ria.libdigidocpp"
minSdkVersion 21
targetSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"
if (System.getenv("BUILD_NUMBER")) {
Expand All @@ -24,47 +26,48 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
sourceSets.main.java.srcDirs += [libsPath + '.androidarm/include']
}

dependencies {
implementation 'androidx.core:core:1.0.0'
implementation 'androidx.core:core:1.6.0'
}

task schemaZip(type:Zip) {
from ('/Library/libdigidocpp.androidarm/etc/digidocpp/schema/') {
println "Create schema zip"
from (libsPath + '.androidarm/etc/digidocpp/schema/') {
include '*'
}
destinationDir file('src/main/res/raw/')
archiveName 'schema.zip'
destinationDirectory = file('src/main/res/raw/')
archiveFileName = 'schema.zip'
}

task copyLibs {
println "Copy jniLibs"
copy {
from fileTree('/Library/libdigidocpp.androidarm') {
from fileTree(libsPath + '.androidarm') {
include 'lib/libdigidoc_java.so', 'arm-linux-androideabi/lib/armv7-a/libc++_shared.so'
}.files
into 'src/main/jniLibs/armeabi-v7a'
}
copy {
from fileTree('/Library/libdigidocpp.androidarm64') {
from fileTree(libsPath + '.androidarm64') {
include 'lib/libdigidoc_java.so', 'aarch64-linux-android/lib/libc++_shared.so'
}.files
into 'src/main/jniLibs/arm64-v8a'
}
copy {
from fileTree('/Library/libdigidocpp.androidx86') {
from fileTree(libsPath + '.androidx86') {
include 'lib/libdigidoc_java.so', 'i686-linux-android/lib/libc++_shared.so'
}.files
into 'src/main/jniLibs/x86'
}
copy {
from fileTree('/Library/libdigidocpp.androidx86_64') {
from fileTree(libsPath + '.androidx86_64') {
include 'lib/libdigidoc_java.so', 'x86_64-linux-android/lib64/libc++_shared.so'
}.files
into 'src/main/jniLibs/x86_64'
}
copy {
from fileTree('/Library/libdigidocpp.androidarm/include/ee/ria/libdigidocpp').files
into 'src/main/java/ee/ria/libdigidocpp/'
}
}

preBuild.dependsOn schemaZip, copyLibs
153 changes: 0 additions & 153 deletions examples/android/app/src/main/java/ee/ria/libdigidocpp/Conf.java

This file was deleted.

48 changes: 0 additions & 48 deletions examples/android/app/src/main/java/ee/ria/libdigidocpp/ConfV2.java

This file was deleted.

48 changes: 0 additions & 48 deletions examples/android/app/src/main/java/ee/ria/libdigidocpp/ConfV3.java

This file was deleted.

Loading

0 comments on commit ccfe21c

Please sign in to comment.