Prepare Environment

Import the SDK dependency

To include Uqudo SDK in your project, you must first add our Maven repository to your build configuration. Below are the instructions for both Groovy (used in build.gradle) and Kotlin DSL (used in build.gradle.kts), ensuring compatibility with your preferred syntax for Gradle scripts.

1- build.gradle (Groovy):

allprojects {
      repositories {
            maven { url "https://rm.dev.uqudo.io/repository/uqudo-public/" }
      } 
}

2- build.gradle.kts (Kotlin DSL):

allprojects {
    repositories {
        maven(url = "https://rm.dev.uqudo.io/repository/uqudo-public/")
    }
}

or in your:

1- settings.gradle (Groovy):

dependencyResolutionManagement {
      repositories {
            maven { url "https://rm.dev.uqudo.io/repository/uqudo-public/" }
      } 
}

2- settings.gradle.kts (Kotlin DSL):

dependencyResolutionManagement { 
        repositories { 
                maven(url = "https://rm.dev.uqudo.io/repository/uqudo-public/")
         } 
  }

Add the following dependency in your application build.gradle. Please make sure the apk generation is split by platform to reduce the size of the apk or use the bundle build (preferred way) when you push your application to the store, Google Play Store will take care to split by platform:

1- build.gradle (Groovy):

android {
      compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8 
            targetCompatibility JavaVersion.VERSION_1_8
      }
      splits {
            abi {
                  enable true
                  universalApk false
            }
      }
}
dependencies {
      implementation 'io.uqudo.sdk:Uqudo:3.3.0'
}

2- build.gradle.kts (Kotlin DSL):

android {
    compileOptions {
        sourceCompatibility(JavaVersion.VERSION_1_8)
        targetCompatibility(JavaVersion.VERSION_1_8)
    }
    splits {
        abi {
            isEnable = true
            isUniversalApk = false
        }
    }
}

dependencies {
    implementation("io.uqudo.sdk:Uqudo:3.3.0")
}

N.B.: It is crucial to highlight a key configuration that must be present in the buildTypes within the release block, or within any other build flavor where the minifyEnabled property (formerly known as ProGuard) is activated. Ensure the inclusion of the following ProGuard configuration line:

proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")

Build using a custom endpoint

N.B.: this is only required if you have an on prem installation of the uqudo platform. Also, only certain domains are permitted.

In order to build your application and tell the SDK to point to another environment you can simply configure the following string resource in your application strings.xml with the provided url:

<string name="uq_api_base_url">https://hostname</string>

N.B.: Don’t add any / after the hostname.

Last updated