Skip to main content

Android SDK Installation

Install the Told SDK in your Android application to display in-app surveys.

Requirements
  • Android project with Kotlin
  • A source created for your Android app

The Installation page in your dashboard

After creating an Android source, Told brings you to its Installation page (sidebar Settings → Installation). This page is a guided wizard that walks you through the four steps required to set up the SDK.

You can come back to it at any time from the source sidebar.

1. Add application ID

This step asks you to register the application ID (package name) of your Android app. Enter it in the textbox and click Add (Ajouter).

Once added, the field is replaced by a small table showing the registered application ID, its OS, its status (To be validated) and a link to the documentation.

Each source supports a single application ID at a time.

2. Add Told to dependencies

Add the Told dependency to your app/build.gradle.kts file:

dependencies {
implementation("club.told:told-android-sdk:2.1.1")
}

Ensure mavenCentral() is in your repositories (settings.gradle.kts).

Click Copy code to copy the line directly from the dashboard.

3. Add permissions

Told requires the INTERNET permission in your AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />

4. Initialize the SDK

The dashboard provides a Kotlin snippet to initialize the SDK in a class extending Application. The snippet already contains your Source ID — just paste it as-is.

import android.app.Application
import com.told.sdk.Told
import com.told.sdk.ToldConfiguration
import com.told.sdk.ToldEnvironment

class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
Told.init(
configuration = ToldConfiguration(
sourceId = "YOUR_SOURCE_ID",
applicationId = applicationContext.packageName,
appVersion = "1.0.0",
environment = ToldEnvironment.Production,
)
)
}
}

Don't forget to register your Application class in the AndroidManifest.xml:

<application android:name=".MyApplication" ...>
...
</application>
ParameterTypeDescription
sourceIdStringYour source ID from the Told dashboard
applicationIdStringYour app's package name
appVersionStringYour app version
environmentToldEnvironmentToldEnvironment.Production or ToldEnvironment.Development
languageString?Override device language (optional, auto-detected if null)
previewBooleanEnable preview mode (optional, defaults to false)

You can also pass a completion callback to be notified when initialization succeeds or fails:

Told.init(
configuration = ToldConfiguration(
sourceId = "YOUR_SOURCE_ID",
applicationId = applicationContext.packageName,
appVersion = "1.0.0",
environment = ToldEnvironment.Production,
),
completion = { success ->
Log.d("Told", "Initialization: $success")
}
)

Installation methods

The dashboard wizard installs Told via Gradle. Alternative installation methods are documented separately:

Verify installation

After building and running your app, you can verify the SDK is loaded by calling the debug function:

Told.debugWidget()

This logs diagnostic information to Logcat with the tag Told.