Skip to main content

Apache Maven

1. Installation

The initial step doesn't involve code; it occurs directly on our platform:

If it is not already done, you need to create a source:

  1. Click on Sources in the left panel.
  2. Click on + card.
  3. Use In app survey.
  4. Use Android and enter a name for your source (it can be anything you want, it is just use to identify your source on our platform).
  5. Go to the installation page: https://{TOLD_URL}/source/{YOUR_SOURCE_ID}/installation
  6. Register your application ID
  7. Include the Told Android SDK dependency in your Maven project's pom.xml file:
<dependency>
<groupId>club.told</groupId>
<artifactId>told-android-sdk</artifactId>
<version>2.1.0</version>
</dependency>

If Maven Central is not already included in your Maven project, add it to your pom.xml file:

<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>

2. Initialization

A common approach is to set up the Told SDK within your class that extends Application.

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

class MyApplication : Application() {

override fun onCreate() {
super.onCreate()
Told.init(
configuration = ToldConfiguration(
sourceId = "MySourceId",
applicationId = applicationContext.packageName,
appVersion = "${BuildConfig.VERSION_NAME}#${BuildConfig.VERSION_CODE}",
environment = ToldEnvironment.Production,
preview = false,
),
applicationContext = applicationContext
)
}
}

Please ensure that:

  • Told.init is called only once during your app lifecycle.
  • You use the applicationContext and not a Context linked to an activity, fragment or a Composable.

3. Verification

Relaunch your application and if you have set everything up correctly, the status of your source should change to "Installed".

If the status remains unchanged, you can try the following steps:

  • Ensure that you are correctly calling the SDK's init function.
  • Verify that the source ID is accurate.
  • Refresh the installation page to update the status.
  • Check your Logcat for details. You can filter with tag:Told.

If none of these steps resolve the issue, please feel free to contact us directly via the "Contact us" button on our platform.