kin-android

Kin Logo Base Compat Module

KDoc Maven Central

The :base-compat module provides support for backup & restore.

This version is based on the new :base module under the covers, which gives higher performance and reliability that you depend on.

Requirements

Android API 19+

Installation

repositories {
    // ...
    mavenCentral()
}
dependencies {
    // ...
    implementation "org.kin.sdk.android:base-compat:${versions.kin}"
    implementation("org.kin.sdk.android:base:${versions.kin}") {
        exclude module: 'libsodium-jni'
    }
}

Both base-compat and base rely on the libsodium module, so excluding it from base prevents dependency conflicts.

Shaded Artifact

Alternatively, there is a shaded artifact for those that are having difficuly resolving common dependencies (e.g. grpc, guava, other google transitive deps)

dependencies {
    // ...
    // The shaded repo doesn't pulling transitive dependencies aautomatically, so add these manually
    implementation 'org.slf4j:slf4j-api:1.7.25'
    implementation 'net.i2p.crypto:eddsa:0.3.0'
    implementation 'io.perfmark:perfmark-api:0.23.0'
    implementation "org.kin.sdk.android:base-compat-shaded:${versions.kin}"
    implementation("org.kin.sdk.android:base-shaded:${versions.kin}") {
        exclude module: 'libsodium-jni'
    }
}

This variant is recommended when encountering dependency collisions (e.g. duplicate classes, incompatible versions, etc).
If you are still encountering difficulties with dependency collisions with this variant we recommend forking the library and adding additional libraries you want to shade to the list included under the shadowJar task configured in ../base/build.gradle

Backup & Restore

To backup, you can call the following to start that UI flow:

 BackupAndRestoreManager(activity, 1, 2)
            .backup(kinEnvironment, KinAccount.Id(accountAddressString))

and to restore, you can call the following to start that UI flow:

BackupAndRestoreManager(launchActivity, 1, 2).restore(kinEnvironment)

Documentation for versions < 1.0

kin-sdk-android is now Deprecated but see the old documentation or API reference for more details on how to use it.