From f19fc3ed0a7bb86688d2ecb7cc005255dd553421 Mon Sep 17 00:00:00 2001 From: Xavier Gouchet Date: Thu, 10 Nov 2022 09:49:44 +0100 Subject: [PATCH] Fix sample in README --- dd-sdk-android/README.md | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/dd-sdk-android/README.md b/dd-sdk-android/README.md index bfa7310abf..289bc926fb 100644 --- a/dd-sdk-android/README.md +++ b/dd-sdk-android/README.md @@ -19,25 +19,21 @@ in Datadog. **Make sure you create a key of type `Client Token`.** ```kotlin class SampleApplication : Application() { - - override fun onCreate() { - super.onCreate() - Datadog.initialize(this, BuildConfig.DD_CLIENT_TOKEN) - } -} -``` - -### Setup for Europe - -If you're targeting our [Europe servers](https://datadoghq.eu), you can -initialize the library like this: - -```kotlin -class SampleApplication : Application() { - override fun onCreate() { super.onCreate() - Datadog.initialize(this, BuildConfig.DD_CLIENT_TOKEN, Datadog.DATADOG_EU) + val configuration = Configuration.Builder( + logsEnabled = true, + tracesEnabled = true, + crashReportsEnabled = true, + rumEnabled = true + ) + .useSite(DatadogSite.US1) // replace with the site you're targetting (e.g.: US3, EU1, …) + .trackInteractions() + .trackLongTasks(durationThreshold) + .useViewTrackingStrategy(strategy) + .build() + val credentials = Credentials(CLIENT_TOKEN, ENV_NAME, APP_VARIANT_NAME, APPLICATION_ID) + Datadog.initialize(this, credentials, configuration, trackingConsent) } } ```