Skip to content

Commit

Permalink
Fix sample in README
Browse files Browse the repository at this point in the history
  • Loading branch information
xgouchet committed Nov 10, 2022
1 parent b41e46f commit f19fc3e
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions dd-sdk-android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
```
Expand Down

0 comments on commit f19fc3e

Please sign in to comment.