Skip to main content

How to: Build Integration

Follow this guide to include the Android Client SDK in your app's dependencies.

Step 1: Add hiya_services.json to your project

When you sign up to use the SDK Hiya will provide you with a hiya_services.json file which needs to be placed in your app's res/raw/ directory.

Example hiya_services.json file:

{
"products": [
{
"api_key": "your_api_key_from_hiya",
"product_id": "Supplied From Hiya",
"package_name": "your.app.package.name"
}
]
}

Step 2: Add SDK dependency to your Gradle config

Hiya SDKs are hosted at Artifactory. To use the libraries, add the following snippets in the project build.gradle.

Configure Maven credentials

In order to access Hiya's Maven repository you will need to add your access credentials to your global gradle properties. Do not include your credentials in your app's codebase.

~/.gradle/gradle.properties:

hiyaUserName=your_hiya_provided_username
hiyaPassword=your_hiya_provided_password

Add Maven Repository

Add Hiya's maven repository with username and password to your app's project level settings.gradle.kts:

val hiyaUserName: String by settings
val hiyaPassword: String by settings

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
maven {
url = uri("https://hiyapartners.jfrog.io/hiyapartners/partner-mvn")
credentials {
username = hiyaUserName
password = hiyaPassword
}
}
google()
mavenCentral()
}
}

Add SDK Dependency

Add the Hiya's Client dependency to the app's lib.versions.toml version catalog and build.gradle.kts.

libs.versions.toml

[versions]
hiyaClientSDK = "6.0.0"

...

[libraries]
hiya-client-sdk = { group = "com.hiya.android.common", name = "calleridui", version.ref = "hiyaClientSDK" }

App level build.gradle.kts

dependencies {
implementation(libs.hiya.client.sdk)
}

Add FileProvider Authority

Hiya SDK uses FileProvider internally to provide downloaded images. To avoid conflict with other applications, we need the authority set with the applicationId so that it doesn’t conflict with other providers.

android {
defaultConfig {
resValue "string", "FILE_PROVIDER_AUTHORITIES","${applicationId}.hiyafileprovider"
}
}

Step 3: Initialize the SDK

Finally, to enable SDK functionality and to ensure that your integration is successful you need to call HiyaService.register(context)