The legacy Android (Java) SDK coupled session tracking with lifecycle events, meaning sessions could only work when lifecycle tracking was enabled.
In the new Android (Kotlin) SDK, session tracking is decoupled from lifecycle events, ensuring sessions can work independently even when lifecycle tracking is turned off.
The Android (Kotlin) SDK also provides a dedicated SessionConfiguration object to configure session tracking independently.
// New SDK - configure independently
valconfiguration=Configuration(writeKey="WRITE_KEY",application=application,dataPlaneUrl="DATA_PLANE_URL",trackApplicationLifecycleEvents=false,// Lifecycle events off
sessionConfiguration=SessionConfiguration(automaticSessionTracking=true// Sessions still work
))
Destination-ready callbacks with success and failure handling
The Android (Kotlin) SDK provides structured result handling for destination initialization, replacing the legacy Android (Java) SDK’s simple callback approach.
Direct access to destination instances
The Android (Kotlin) SDK provides direct access to destination instances via the getDestinationInstance() method, without requiring a callback to be registered immediately after SDK initialization, unlike the legacy approach.
Custom context
The legacy Android (Java) SDK provided a putCustomContext() method that accepted Map<String, Object> as the value, requiring you to always pass a nested map structure.
The Android (Kotlin) SDK accepts any JSON value type, including simple strings.
The Android (Kotlin) SDK lets you set externalId via RudderOption in all event types: track, screen, group, alias and identify. The legacy Android (Java) SDK only supported the identify event type.
The Android (Kotlin) SDK removes redundant user identity fields from context.traits that were unnecessarily duplicated in the legacy Android (Java) SDK, thereby reducing payload size and eliminating unnecessary data inconsistency risks.
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.