Skip to content

Setup Kotlin client

mrQoldy edited this page Mar 30, 2023 · 1 revision

Using of Kotlin client with Android application

1. Gradle setup

Gradle is configured with Github packages publish tool. To use dependency you should add following repository:

maven {
    url = uri("https://maven.pkg.github.com/atelier-saulx/based-android")
    credentials {
    username = System.getenv("BASED_ANDROID_USERNAME")
    password = System.getenv("BASED_ANDROID_KEY")
    }
}

System variables are equal to:

BASED_ANDROID_USERNAME - atelier-saulx
BASED_ANDROID_KEY - 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

2. Include client library

Kotlin client is configured as java-library so it takes default Java implementation of jna. It must be excluded from both dependencies and imported manually with @aar postfix:

implementation("com.saulx.based-android-client:core:$client_version") { exclude group: 'net.java.dev.jna'} implementation("com.saulx.based-android-client:gson:client_version") {exclude group: 'net.java.dev.jna'} implementation "net.java.dev.jna:jna:5.12.1@aar"

3. Include .so files

Gradle is not configured for publishing .so files and it must be included manually. Actual native library files are located at the path:

Also c libraries will be published with each release

Copy the folder and place it at the same path at your application