Skip to content

Installation

Requirements

The Android SDK requires SDK version >=24 with Kotlin version >= 1.7. The SDK is provided as multiple AAR files. These files are so-called fat AARs, bundling dependencies which are not publicly available.

Getting started

All SDK packages are accessible in a maven repository. Adding this access repository to your android project requires specifying an access token that you can generate on GitLab:

  1. Go to the Access Tokens section in your profile and create an access token with a scope of read_api. Save it right to the clip board right away.
  2. Create (or edit) file ~/.gradle/gradle.properties and add your access token. In order to work flawlessly with the provided sample configuration, we suggest you to use the token name that is already used in the example: gitLabComunyPrivateToken. Add a line like: gitLabComunyPrivateToken=<your access token>.
  3. Add the Trinity ID Wallet SDK dependencies:
    1. Main SDK dependency implementation "de.comuny:trinityidwallet:VERSION"
    2. Module dependecies regarding your needs:
      • Twilio module dependency implementation "de.comuny.module:twilio:VERSION"
    3. Additional dependencies (AndroidX lifecycle, retrofit2) have to be added as well. (TBD)
  4. Use the SDK.

Adding to the project

Gradle / maven

settings.gradle
repositories {
    maven {
        name = 'comunyGitLab'
        url "https://git.cls.comuny.de/api/v4/projects/4/packages/maven"
        credentials(HttpHeaderCredentials) {
            name = "Private-Token"
            value = gitLabComunyPrivateToken
        }
        authentication {
            header(HttpHeaderAuthentication)
        }
    }
}
build.gradle
1
2
3
4
5
6
7
8
dependencies {
    def trinityIDWalletVersion = "X.Y.Z"
    implementation "de.comuny:trinityidwallet:$trinityIDWalletVersion"

    implementation "de.comuny.module:authada:$trinityIDWalletVersion"
    implementation "de.comuny.module:twilio:$trinityIDWalletVersion"
    implementation "de.comuny.module:idnow:$trinityIDWalletVersion"
}

Manually

Alternatively you can also add the artifacts as external dependencies to your project.

First create a folder called libs in your project and move aar packages there.

Project structure
1
2
3
4
5
project
    app
    build
    gradle
    libs

Then add the following code to your build gradle.

settings.gradle
1
2
3
4
5
repositories {
    flatDir{
        dirs 'libs'
    }
}
or
build.gradle
1
2
3
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.aar'])
}
and you also have to add these dependencies
build.gradle
dependencies {
    implementation "org.jetbrains.kotlinx:kotlinx-serialization-core:$kotlin_serialization_version"
    implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialization_version"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$kotlin_coroutines_version"
    implementation "org.jetbrains.kotlinx:kotlinx-datetime:$kotlin_date_time_version"
    implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
    implementation "io.ktor:ktor-client-okhttp:$ktor_version"
    implementation "io.ktor:ktor-client-serialization-jvm:$ktor_version"
    implementation "org.bitbucket.b_c:jose4j:$jose_version"
}

Note

For more information about dependencies, see official documentation.

Releases

The latest release is available on GitLab.