Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update android example project and link with iconv #423

Merged
merged 1 commit into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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