Skip to content

Commit 3de5eb1

Browse files
committed
update the doc with the latest sdk setup
1 parent a4766e4 commit 3de5eb1

File tree

1 file changed

+13
-4
lines changed
  • src/connections/sources/catalog/libraries/mobile/kotlin-android

1 file changed

+13
-4
lines changed

src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To get started with the Analytics-Kotlin mobile library:
2525
2. Search for **Kotlin (Android)** and click **Add source**.
2626
2. Add the Analytics dependency to your build.gradle.
2727

28-
Segment recommends you to install the library with a build system like Gradle, as it simplifies the process of upgrading versions and adding integrations. The library is distributed through [Maven Central](https://search.maven.org/search?q=g:com.segment.analytics.kotlin){:target="_blank"}. Add the analytics module to your build.gradle as a dependency as shown in the code sample below, and replace `<latest_version>` with the latest version listed in [Maven Central](https://search.maven.org/search?q=g:com.segment.analytics.kotlin){:target="_blank"}
28+
Segment recommends you to install the library with a build system like Gradle, as it simplifies the process of upgrading versions and adding integrations. The library is distributed through [Maven Central](https://repo1.maven.org/maven2/com/segment/analytics/kotlin/android/){:target="_blank"}. Add the analytics module to your build.gradle as a dependency as shown in the code sample below, and replace `<latest_version>` with the latest version listed in our [releases page](https://github.com/segmentio/analytics-kotlin/releases){:target="_blank"}
2929

3030
```
3131
repositories {
@@ -51,6 +51,9 @@ To get started with the Analytics-Kotlin mobile library:
5151
}
5252
```
5353
54+
> warning ""
55+
> **Note:** In android, application context is required to pass as the second parameter, or an error `Using JVM Analytics initializer in Android platform. Context is required in constructor!` will be thrown out.
56+
5457
Automatically tracking lifecycle events (`Application Opened`, `Application Installed`, `Application Updated`) is optional, but Segment highly recommends you to configure these options in order to track core events.
5558
5659
<br>**Note:** Unlike the Analytics-Android SDK, the Analytics-Kotlin SDK doesn’t provide a singleton instance and relies on you to keep track of the instance.
@@ -83,6 +86,12 @@ To get started with the Analytics-Kotlin mobile library:
8386
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
8487
```
8588
89+
5. Enable Java 8+ API desugaring
90+
91+
The SDK internally uses a number of Java 8 language APIs through desugaring. Please make sure your project:
92+
* either enables desugaring (see how to enable it [here](https://developer.android.com/studio/write/java8-support#library-desugaring))
93+
* or requires a minimum API level of 26.
94+
8695
## Tracking Methods
8796
8897
Once you’ve installed the mobile or server Analytics-Kotlin library, you can start collecting data through Segment’s tracking methods:
@@ -439,8 +448,8 @@ To test your destination:
439448

440449
Segment recommends you to test your destination implementation end-to-end. Send some sample analytics events and ensure that they reach the destination.
441450

442-
## Changelog
443-
[View the Analytics-Kotlin changelog on GitHub](https://github.com/segmentio/analytics-kotlin/releases).
444-
445451
## Compatibility
446452
[View the Analytics-Kotlin compatibility notes on GitHub](https://github.com/segmentio/analytics-kotlin#compatibility).
453+
454+
## Changelog
455+
[View the Analytics-Kotlin changelog on GitHub](https://github.com/segmentio/analytics-kotlin/releases).

0 commit comments

Comments
 (0)