---
title: "Android-Kotlin SDK reference"
description: "Every public method, class, plugin hook, and configuration option in the Amplitude Android-Kotlin SDK, verified against version 1.36.0, with signatures, types, defaults, and examples."
product: analytics
lang: en
last_updated: 2026-11-04
token_estimate: 7575
---
# Android-Kotlin SDK reference

This reference documents every public export of `com.amplitude:analytics-android` that you use to instrument an app, and every configuration option, verified against version 1.36.0. Classes that the SDK marks "Not intended for public use", such as its storage and timeline classes, aren't listed. For options, go to [Configuration options](#configuration-options). To find the release that added or changed a feature, go to [Android-Kotlin SDK release notes](https://amplitude.com/docs/sdks/analytics/android/android-kotlin-sdk-release-notes).

> For AI agents: a documentation index is available at [/docs/llms.txt](/docs/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

```kotlin
import com.amplitude.android.Amplitude
import com.amplitude.android.Configuration
import com.amplitude.android.ConfigurationBuilder
```

The SDK exposes `com.amplitude:analytics-core` as an API dependency, so core types such as `com.amplitude.core.events.Identify` and `com.amplitude.core.ServerZone` are on your classpath. `com.amplitude.android.events` re-exports `BaseEvent`, `EventOptions`, `Identify`, `IdentifyEvent`, `GroupIdentifyEvent`, `Revenue`, `RevenueEvent`, `Plan`, and `IngestionMetadata`. Every method on this page is a method of the `Amplitude` instance. Most return the instance, so calls chain.

## Setup

### Amplitude

Creates an instance and starts setup in the background.

```kotlin
// Kotlin DSL (top-level function)
fun Amplitude(apiKey: String, context: Context, configs: ConfigurationBuilder.() -> Unit): Amplitude

// Constructor
Amplitude(configuration: Configuration)
```

| Parameter | Type | Description |
| --- | --- | --- |
| `apiKey` | `String` | Your Amplitude project API key. A blank key throws `IllegalArgumentException("invalid configuration")`. |
| `context` | `Context` | Your `Application`. The SDK casts it to `Application`, so an `Activity` context throws `ClassCastException`. |
| `configs` | `ConfigurationBuilder.() -> Unit` | Sets [configuration options](#configuration-options). |
| `configuration` | `Configuration` | A configuration from `ConfigurationBuilder.build()` or the `Configuration` constructor. |

#### Kotlin

```kotlin
val amplitude = Amplitude("YOUR_API_KEY", applicationContext) {
    flushQueueSize = 20
}
```

#### Java

```java
ConfigurationBuilder builder = new ConfigurationBuilder("YOUR_API_KEY", getApplicationContext());
builder.setFlushQueueSize(20);
Amplitude amplitude = new Amplitude(builder.build());
```

`ConfigurationBuilder` requires 1.27.0 or later. In Java, use it instead of `new Configuration(apiKey, context)`: only the deprecated `Configuration` constructor has Java overloads, and it can't set `autocapture`, `interactionsOptions`, `httpClient`, `enableDiagnostics`, `enableRequestBodyCompression`, or `enableAutocaptureRemoteConfig`. Java can also call the DSL as `AmplitudeKt.Amplitude(...)`.

Creating an instance with the same `instanceName` as a live instance retires the older one. The older instance logs `Amplitude instance '<name>' was replaced by a newer instance with the same name and is now inactive.` and drops new events. Requires 1.30.1 or later.

### isBuilt

Completes when setup finishes: storage, stored identity, legacy data migration, and plugins.

```kotlin
val isBuilt: Deferred<Boolean>
```

```kotlin
amplitude.isBuilt.await() // inside a coroutine
```

### add

Registers a plugin. If a plugin with the same non-null `name` is already registered, the SDK keeps one.

```kotlin
fun add(plugin: Plugin): Amplitude
fun add(plugin: UniversalPlugin): Amplitude
```

### remove

Removes a plugin you added. Pass the same instance.

```kotlin
fun remove(plugin: Plugin): Amplitude
fun remove(plugin: UniversalPlugin): Amplitude
```

### findPlugin, plugin, and plugins

Look up registered plugins.

```kotlin
inline fun <reified T : Plugin> findPlugin(): T?
fun plugin(name: String): UniversalPlugin?
fun <T> plugins(clazz: Class<T>): List<T>
```

### flush

Uploads queued events now. Returns right away; the upload runs in the background after setup finishes.

```kotlin
fun flush()
```

### logger

The instance logger. Default: Logcat with the tag `Amplitude`, level `INFO`.

```kotlin
val logger: Logger
```

```kotlin
amplitude.logger.logMode = Logger.LogMode.DEBUG
```

`Logger.LogMode` values: `DEBUG`, `INFO`, `WARN`, `ERROR`, `OFF`.

## Tracking

### track

Queues an event for upload.

```kotlin
@JvmOverloads
fun track(eventType: String, eventProperties: Map<String, Any?>? = null, options: EventOptions? = null): Amplitude

@JvmOverloads
fun track(event: BaseEvent, options: EventOptions? = null, callback: EventCallBack? = null): Amplitude
```

| Parameter | Type | Description |
| --- | --- | --- |
| `eventType` | `String` | The event name. The SDK drops an event with a blank name and logs `Event has an empty event type, dropping it.` |
| `eventProperties` | `Map<String, Any?>?` | Optional. Event properties. |
| `event` | `BaseEvent` | Optional. A full event. Go to [BaseEvent](#baseevent). |
| `options` | `EventOptions?` | Optional. Overrides fields such as `userId`, `timestamp`, or `sessionId` for this event. Go to [EventOptions](#eventoptions). |
| `callback` | `EventCallBack?` | Optional. Runs when the SDK finishes with this event. Go to [EventCallBack](#eventcallback). |

```kotlin
amplitude.track("Song Played", mapOf("title" to "Happy Birthday"))
```

`logEvent(event: BaseEvent)` is deprecated. Use `track`.

### identify

Sends user property operations as an `$identify` event.

```kotlin
@JvmOverloads
fun identify(identify: Identify, options: EventOptions? = null): Amplitude

@JvmOverloads
fun identify(userProperties: Map<String, Any?>?, options: EventOptions? = null): Amplitude
```

The `Map` form sets each property. It drops entries whose value is `null`, so it can't unset a property; use `Identify().unset()`. When `options` sets `userId` or `deviceId`, the SDK applies them to the instance's identity along with the properties.

```kotlin
amplitude.identify(Identify().set("plan", "premium").add("login_count", 1))
```

The SDK merges identify events that contain only `set` operations and sends them after `identifyBatchIntervalMillis`, or before the next other event. Requires 1.7.0 or later.

### setGroup

Assigns the user to a group, and sets `groupType` as a user property.

```kotlin
@JvmOverloads
fun setGroup(groupType: String, groupName: String, options: EventOptions? = null): Amplitude

@JvmOverloads
fun setGroup(groupType: String, groupName: Array<String>, options: EventOptions? = null): Amplitude
```

```kotlin
amplitude.setGroup("orgId", "15")
amplitude.setGroup("sport", arrayOf("tennis", "soccer"))
```

### groupIdentify

Sets properties on a group with a `$groupidentify` event.

```kotlin
@JvmOverloads
fun groupIdentify(groupType: String, groupName: String, identify: Identify, options: EventOptions? = null): Amplitude

@JvmOverloads
fun groupIdentify(groupType: String, groupName: String, groupProperties: Map<String, Any?>?, options: EventOptions? = null): Amplitude
```

```kotlin
amplitude.groupIdentify("plan", "enterprise", Identify().set("seats", 50))
```

### revenue

Tracks a `revenue_amount` event.

```kotlin
@JvmOverloads
fun revenue(revenue: Revenue, options: EventOptions? = null): Amplitude
fun revenue(event: RevenueEvent): Amplitude
```

The SDK drops a `Revenue` without `price` and logs `Invalid revenue object, missing required fields`. Go to [Revenue](#revenue-class). `logRevenue(revenue: Revenue)` is deprecated. Use `revenue`.

## Identity

### getUserId and setUserId

```kotlin
fun getUserId(): String?
fun setUserId(userId: String?): Amplitude
```

`null` clears the user ID. Setting the current value again does nothing.

### getDeviceId and setDeviceId

```kotlin
fun getDeviceId(): String?
fun setDeviceId(deviceId: String): Amplitude
```

`getDeviceId()` can return `null` until [`isBuilt`](#isbuilt) completes. For how the SDK picks a device ID, go to [How the SDK chooses identifiers on startup](https://amplitude.com/docs/sdks/analytics/android/android-kotlin-sdk/instrument-and-configure#how-the-sdk-chooses-identifiers-on-startup).

### reset

Clears the user ID and the local user properties from `setIdentity`, then picks a device ID again. Doesn't start a new session.

```kotlin
fun reset(): Amplitude
```

`reset()` skips only the stored device ID. It keeps the same device ID when you set the `deviceId` configuration option, `useAdvertisingIdForDeviceId`, or `useAppSetIdForDeviceId`. To get a new device ID, call `setDeviceId()` after `reset()`.

### identity and setIdentity

Reads or replaces the user ID, device ID, and local user properties in one step.

```kotlin
val identity: AnalyticsIdentity

fun setIdentity(identity: AnalyticsIdentity): Amplitude

@JvmOverloads
fun setIdentity(userId: String?, deviceId: String?, userProperties: Map<String, Any?> = emptyMap()): Amplitude
```

`AnalyticsIdentity` has `userId`, `deviceId`, and `userProperties`. The user properties live in memory for the current process and aren't stored. When `setIdentity` changes them to a non-empty map, the SDK sends one `$identify` event that sets them. Removing a property from the map doesn't unset it in Amplitude. Passing `deviceId = null` clears the device ID, and omitting `userProperties` clears the local map. While opted out, the SDK updates the local identity but sends nothing.

```kotlin
amplitude.isBuilt.await()
amplitude.setIdentity("user-123", amplitude.getDeviceId(), mapOf("plan" to "paid"))
```

`identity` requires 1.30.0 or later. `setIdentity` and `identity.userProperties` require 1.36.0 or later.

## Sessions

### sessionId

The current session ID, a timestamp in milliseconds, or `-1` before the first session starts.

```kotlin
val sessionId: Long // Java: getSessionId()
```

`Amplitude.START_SESSION_EVENT` is `"session_start"` and `Amplitude.END_SESSION_EVENT` is `"session_end"`.

`onEnterForeground(timestamp)` and `onExitForeground(timestamp)` are public but guarded with `@GuardedAmplitudeFeature` for SDK developers. The SDK detects foreground from the process lifecycle, so don't call them.

## Privacy

### optOut

Turns tracking off or on at runtime. While `true`, the SDK drops every event with `Skip event for opt out config.`

```kotlin
var optOut: Boolean // Java: getOptOut() / setOptOut(boolean)
```

## Identify

`com.amplitude.core.events.Identify`. Every method returns the `Identify`, so calls chain.

| Method | Values | Description |
| --- | --- | --- |
| `set(property, value)` | `Boolean`, `Double`, `Float`, `Int`, `Long`, `String`, `Map`, `List`, arrays, `Any` | Sets the value. Overwrites an existing value. |
| `setOnce(property, value)` | Same as `set` | Sets the value only if the property has no value. |
| `add(property, value)` | `Double`, `Float`, `Int`, `Long` | Adds to a numeric property. |
| `append(property, value)` | Same as `set`, except `Any` | Appends to an array property. |
| `prepend(property, value)` | Same as `append` | Prepends to an array property. |
| `preInsert(property, value)` | Same as `append` | Prepends if the value isn't already in the array. |
| `postInsert(property, value)` | Same as `append` | Appends if the value isn't already in the array. |
| `remove(property, value)` | Same as `append` | Removes the value from an array property. |
| `unset(property)` | None | Removes the property. |
| `clearAll()` | None | Removes every user property. Discards other operations in this `Identify`. Permanent. |

An `Identify` ignores an operation with an empty property name or a `null` value, a second operation on the same property, and any operation after `clearAll()`. It prints a warning to standard output, not Logcat.

## Revenue class

`com.amplitude.core.events.Revenue`.

| Property | Type | Default | Description |
| --- | --- | --- | --- |
| `price` | `Double?` | `null` | Required. Price of one item. Can be negative. Assigning `null` has no effect. |
| `quantity` | `Int` | `1` | Number of items. Ignores values of 0 or less. |
| `productId` | `String?` | `null` | Product identifier, such as the Google Play product ID. Ignores empty values. |
| `revenue` | `Double?` | `null` | Total revenue. When unset, Amplitude computes `price × quantity`. |
| `revenueType` | `String?` | `null` | Revenue type, such as `refund`. Required for revenue verification. |
| `currency` | `String?` | `null` | Three-letter currency code. |
| `receipt` | `String?` | `null` | Receipt identifier. |
| `receiptSig` | `String?` | `null` | Receipt signature. Required for revenue verification. Java: `setReceiptSig()`. |
| `properties` | `MutableMap<String, Any?>?` | `null` | Extra event properties. |

`setReceipt(receipt: String, receiptSignature: String): Revenue` sets `receipt` and `receiptSig` together. `isValid()` returns `true` when `price` is set.

## Events

### BaseEvent

`com.amplitude.core.events.BaseEvent` extends [`EventOptions`](#eventoptions) and adds:

| Property | Type | Description |
| --- | --- | --- |
| `eventType` | `String` | Required. The event name. |
| `eventProperties` | `MutableMap<String, Any?>?` | Event properties. |
| `userProperties` | `MutableMap<String, Any?>?` | User property operations. |
| `groups` | `MutableMap<String, Any?>?` | Groups for this event only. |
| `groupProperties` | `MutableMap<String, Any?>?` | Group property operations. |

The SDK serializes at most 1024 keys in a property map and truncates strings to 1024 characters. A map with more keys throws `IllegalArgumentException("Too many properties (more than 1024) in JSON")` during upload. `IdentifyEvent` (`$identify`), `GroupIdentifyEvent` (`$groupidentify`), and `RevenueEvent` (`revenue_amount`) extend `BaseEvent`.

### EventOptions

`com.amplitude.core.events.EventOptions`. Every field is a nullable `var`. A value you set overrides what the SDK would fill in.

| Fields | Description |
| --- | --- |
| `userId`, `deviceId` | Identity for this event. |
| `timestamp`, `eventId`, `sessionId`, `insertId` | Time in milliseconds, event sequence number, session, and deduplication ID. `sessionId = -1` sends the event outside any session. |
| `locationLat`, `locationLng`, `country`, `region`, `city`, `dma`, `ip`, `language`, `carrier` | Location and locale. |
| `appVersion`, `versionName`, `platform`, `osName`, `osVersion`, `deviceBrand`, `deviceManufacturer`, `deviceModel`, `library` | App, device, and SDK fields. |
| `idfa`, `idfv`, `adid`, `appSetId`, `androidId` | Advertising and device identifiers. |
| `price`, `quantity`, `productId`, `revenue`, `revenueType`, `currency` | Revenue fields. |
| `plan`, `ingestionMetadata`, `partnerId` | Go to [Plan and IngestionMetadata](#plan-and-ingestionmetadata). |
| `callback` | An [`EventCallBack`](#eventcallback) for this event. |
| `extra` | Not sent to Amplitude. Used by Ampli. |

### EventCallBack

```kotlin
typealias EventCallBack = (event: BaseEvent, status: Int, message: String) -> Unit
```

The SDK calls the callback when it finishes with an event: `200` and `Event sent success.` when Amplitude accepts the event, or the HTTP status and server error when the SDK drops it. The SDK doesn't call the callback for responses it retries. Go to [Read the upload result](https://amplitude.com/docs/sdks/analytics/android/android-kotlin-sdk/verify-events#read-the-upload-result).

### Plan and IngestionMetadata

```kotlin
Plan(branch: String? = null, source: String? = null, version: String? = null, versionId: String? = null)
IngestionMetadata(sourceName: String? = null, sourceVersion: String? = null)
```

Both have `@JvmOverloads` constructors. The SDK copies the configured `plan` and `ingestionMetadata` onto each event that doesn't have its own.

## Plugin

`com.amplitude.core.platform.Plugin`.

| Member | Description |
| --- | --- |
| `val type: Plugin.Type` | `Before`, `Enrichment`, `Destination`, `Utility`, or `Observe`. |
| `var amplitude: Amplitude` | The instance. The SDK sets it in `setup`. |
| `fun setup(amplitude: Amplitude)` | Called when you add the plugin. |
| `fun execute(event: BaseEvent): BaseEvent?` | For `Before` and `Enrichment` plugins. Return the event, changed or not, or `null` to drop it. |
| `fun onUserIdChanged(userId: String?)`, `fun onDeviceIdChanged(deviceId: String?)` | Called when the IDs change. |
| `fun onSessionIdChanged(sessionId: Long)`, `fun onOptOutChanged(optOut: Boolean)`, `fun onReset()`, `fun onIdentityChanged(identity: AnalyticsIdentity)` | Called on session, opt-out, reset, and identity changes. Requires 1.30.0 or later. |
| `fun teardown()` | Called when you remove the plugin. |

The SDK runs `Before`, then `Enrichment`, then `Destination` plugins for each event. `Utility` and `Observe` plugins don't receive events.

| Class | Use |
| --- | --- |
| `EventPlugin` | Adds `track`, `identify`, `groupIdentify`, `revenue`, and `flush` callbacks, each receiving the typed event as `payload`. |
| `DestinationPlugin` | Abstract `EventPlugin` with type `Destination`. Override `track` and the other callbacks. Its `execute` is final. |
| `ObservePlugin` | Abstract plugin with type `Observe`. Override `onUserIdChanged` and `onDeviceIdChanged` (required) and any other callbacks. Its `execute` is final. |
| `UniversalPlugin` | The base interface for plugins shared across Amplitude products, such as Session Replay and Experiment. Requires 1.30.0 or later. |

### NetworkTrackingPlugin

`com.amplitude.android.network.NetworkTrackingPlugin` is an OkHttp interceptor and a plugin. It tracks `[Amplitude] Network Request` events for requests through the OkHttp clients you add it to. Requires 1.21.0 or later, and OkHttp on your classpath. The `com.amplitude.core.network` classes with the same names are deprecated.

```kotlin
NetworkTrackingPlugin(options: NetworkTrackingOptions = NetworkTrackingOptions.DEFAULT)
```

#### NetworkTrackingOptions

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `captureRules` | `List<CaptureRule>` | Required | Which requests to capture. The SDK checks rules from last to first; the first rule whose hosts or URLs match decides. |
| `ignoreHosts` | `List<String>` | `[]` | Hosts to never capture. Supports `*` wildcards. |
| `ignoreAmplitudeRequests` | `Boolean` | `true` | Skips requests to Amplitude. |
| `enabled` | `Boolean` | `true` | Turns tracking on or off. |
| `enableRemoteConfig` | `Boolean` | `true` | Lets remote configuration from Amplitude replace the capture rules. |

`NetworkTrackingOptions.DEFAULT` captures every host except Amplitude with status codes 500 to 599. The constructor has `@JvmOverloads`.

#### CaptureRule

Two constructors: by host, or by URL.

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `hosts` | `List<String>` | Required (host rule) | Hosts to capture. Supports `*` wildcards. |
| `urls` | `List<URLPattern>` | Required (URL rule) | `URLPattern.Exact(url)` or `URLPattern.Regex(pattern)`. |
| `methods` | `List<String>` | `[]` | URL rules only. HTTP methods to capture. Empty captures all. |
| `statusCodeRange` | `List<Int>` | `500..599` | Status codes to capture. |
| `requestHeaders` | `CaptureHeader?` | `null` | URL rules only. Captures request headers. Requires 1.28.0 or later. |
| `responseHeaders` | `CaptureHeader?` | `null` | URL rules only. Captures response headers. Requires 1.28.0 or later. |
| `requestBody` | `CaptureBody?` | `null` | URL rules only. Captures JSON request body fields. Requires 1.28.0 or later. |
| `responseBody` | `CaptureBody?` | `null` | URL rules only. Captures JSON response body fields. Requires 1.28.0 or later. |

`CaptureHeader(allowlist: List<String> = [], captureSafeHeaders: Boolean = true)` captures the headers you list, case-insensitive, plus a built-in set of non-sensitive headers. It never captures `authorization`, `cookie`, or `proxy-authorization`. `CaptureBody(allowlist: List<String>, excludelist: List<String> = [])` captures JSON fields by path; `*` matches one level and `**` matches any number of levels.

## Utilities

### FrustrationAnalyticsUtils

Excludes elements from rage and dead click detection. Requires 1.22.0 or later.

```kotlin
FrustrationAnalyticsUtils.ignoreFrustrationAnalytics(view: View, rageClick: Boolean = true, deadClick: Boolean = true)
FrustrationAnalyticsUtils.unignoreView(view: View)
FrustrationAnalyticsUtils.isViewIgnored(view: View): Boolean
FrustrationAnalyticsUtils.isRageClickIgnored(view: View): Boolean
FrustrationAnalyticsUtils.isDeadClickIgnored(view: View): Boolean

// Jetpack Compose
fun Modifier.ignoreFrustrationAnalytics(rageClick: Boolean = true, deadClick: Boolean = true): Modifier
```

In Java, call the object through `FrustrationAnalyticsUtils.INSTANCE`.

### Constants

`com.amplitude.android.Constants.EventTypes` and `com.amplitude.android.Constants.EventProperties` hold the autocapture event and property names, such as `EventTypes.SCREEN_VIEWED` (`[Amplitude] Screen Viewed`). The copies in `com.amplitude.core.Constants` and `DefaultEventUtils` are deprecated.

## Configuration options

Set these in the `Amplitude(apiKey, context) { }` block, on a `ConfigurationBuilder`, or as named arguments to `Configuration(...)`. Options that also have a runtime equivalent on the instance name it in the description.

### Identity and session

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `instanceName` | `String` | `"$default_instance"` | Names the instance. The SDK keeps storage and identity per name. A new instance with the same name retires the old one. |
| `deviceId` | `String?` | `null` | A fixed device ID. The SDK uses it on every start and on `reset()`. Requires 1.14.0 or later. |
| `sessionId` | `Long?` | `null` | The session ID to start with. When `null`, the SDK restores the stored session. Requires 1.15.0 or later. |
| `minTimeBetweenSessionsMillis` | `Long` | `300000` (5 minutes) | How long the app can stay in the background before the next foreground or event starts a new session. |
| `useAdvertisingIdForDeviceId` | `Boolean` | `false` | Uses the advertising ID as the device ID when available and ad tracking isn't limited. Needs `play-services-ads-identifier`. |
| `useAppSetIdForDeviceId` | `Boolean` | `false` | Uses the App Set ID, with `S` appended, as the device ID. Needs `play-services-appset`. |
| `newDeviceIdPerInstall` | `Boolean` | `false` | When `true`, the SDK skips the advertising ID when it picks a device ID. Kept for compatibility with the maintenance Android SDK. |
| `identityStorageProvider` | `IdentityStorageProvider` | `FileIdentityStorageProvider()` | Stores the user ID and device ID. |
| `migrateLegacyData` | `Boolean` | `true` | On first run, moves events and IDs stored by the maintenance Android SDK. Requires 1.9.0 or later. [Default changed in 1.10.2](https://amplitude.com/docs/sdks/analytics/android/android-kotlin-sdk-release-notes#1102). |
| `optOut` | `Boolean` | `false` | Drops every event while `true`. Runtime: `amplitude.optOut`. |

### Data collection

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `trackingOptions` | `TrackingOptions` | `TrackingOptions()` (collects all) | Which device and location fields the SDK collects. Go to [TrackingOptions](#trackingoptions). |
| `enableCoppaControl` | `Boolean` | `false` | Stops collecting the advertising ID, IP address (so Amplitude derives no city), and latitude and longitude. Doesn't stop the App Set ID. |
| `locationListening` | `Boolean` | `false` | Adds the last known latitude and longitude. Also needs a granted location permission. [Default changed in 1.20.7](https://amplitude.com/docs/sdks/analytics/android/android-kotlin-sdk-release-notes#1207). |
| `partnerId` | `String?` | `null` | Partner ID for partner integrations, added to each event. |
| `plan` | `Plan?` | `null` | Tracking plan details added to each event. |
| `ingestionMetadata` | `IngestionMetadata?` | `null` | Source details added to each event. Requires 1.2.0 or later. |
| `minIdLength` | `Int?` | `null` | Minimum length Amplitude accepts for user and device IDs. When `null`, the server minimum of 5 applies. Must be greater than 0. |

#### TrackingOptions

`com.amplitude.android.TrackingOptions`. Each `disable` method returns the object, so calls chain.

| Method | Stops collecting |
| --- | --- |
| `disableAdid()` | The advertising ID. Also stops the SDK reading it. |
| `disableAppSetId()` | The App Set ID. |
| `disableCarrier()` | The carrier, from `TelephonyManager.networkOperatorName`. |
| `disableCountry()` | The country. The SDK sends it only when IP address collection is off. |
| `disableDeviceBrand()` | The device brand. |
| `disableDeviceManufacturer()` | The device manufacturer. |
| `disableDeviceModel()` | The device model. |
| `disableIpAddress()` | The `$remote` IP marker, so Amplitude doesn't use the request IP. |
| `disableLanguage()` | The device language. |
| `disableLatLng()` | Latitude and longitude. |
| `disableOsName()` | The OS name. |
| `disableOsVersion()` | The OS version. |
| `disablePlatform()` | The platform (`Android`). |
| `disableVersionName()` | Your app's version name. |
| `disableCity()`, `disableDma()`, `disableRegion()`, `disableApiLevel()` | Nothing on the device. The SDK doesn't collect these fields; Amplitude derives city, DMA, and region from the IP address. |

### Delivery

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `serverZone` | `ServerZone` | `ServerZone.US` | The data center: `US` or `EU`. Also picks the remote configuration and diagnostics hosts. |
| `serverUrl` | `String?` | `null` | Upload URL, such as a proxy. Overrides `serverZone` and `useBatch` for uploads only. |
| `useBatch` | `Boolean` | `false` | Uploads to the Batch API (`/batch`) instead of HTTP V2. |
| `flushQueueSize` | `Int` | `30` | Uploads when this many events are queued. It doesn't cap request size: each request carries one stored file of up to about 975 KB. |
| `flushIntervalMillis` | `Int` | `30000` | Uploads this long after an event is queued, if `flushQueueSize` wasn't reached. |
| `flushEventsOnClose` | `Boolean` | `true` | Uploads when the app goes to the background. |
| `flushMaxRetries` | `Int` | `5` | Deprecated. Has no effect: the SDK retries failed uploads with no limit. |
| `identifyBatchIntervalMillis` | `Long` | `30000` | How long the SDK holds `set`-only identify events to merge them. Requires 1.7.0 or later. |
| `offline` | `Boolean?` | `false` | `true` holds uploads; events still save. The connectivity plugin updates it when the network changes. `null` (or `AndroidNetworkConnectivityCheckerPlugin.Disabled`) removes the plugin, so only your code sets it. Requires 1.13.0 or later. |
| `enableRequestBodyCompression` | `Boolean` | `false` | Gzips requests to a custom `serverUrl`. The SDK always compresses requests to Amplitude's endpoints. Requires 1.25.1 or later. |
| `httpClient` | `HttpClientInterface?` | `null` (built-in client) | A custom uploader. Implement `upload(events: String, diagnostics: String?): AnalyticsResponse`. Requires 1.20.0 or later. |
| `callback` | `EventCallBack?` | `null` | Runs for every event the SDK finishes with. Go to [EventCallBack](#eventcallback). |
| `storageProvider` | `StorageProvider` | File storage in the app's files directory | Stores queued events. |
| `identifyInterceptStorageProvider` | `StorageProvider` | File storage | Stores identify events held for merging. Requires 1.7.0 or later. |
| `loggerProvider` | `LoggerProvider` | `AndroidLoggerProvider()` (Logcat, tag `Amplitude`, level `INFO`) | Creates the instance logger. |

### Remote configuration and diagnostics

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `enableAutocaptureRemoteConfig` | `Boolean` | `true` | Lets autocapture and network tracking settings from Amplitude override local settings. Settings that Amplitude doesn't send keep their local values. Requires 1.26.0 or later. |
| `enableDiagnostics` | `Boolean` | `true` | Lets the SDK send diagnostics about its own health to Amplitude, not to your project. Amplitude controls the sample rate, which starts at 0, and can turn diagnostics on or off remotely. Requires 1.25.0 or later. |

The SDK fetches remote configuration on every start, at most every 5 minutes, from `sr-client-cfg.amplitude.com` (EU: `sr-client-cfg.eu.amplitude.com`), even when both options are `false`. `serverUrl` doesn't apply to that request.

### Autocapture options

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `autocapture` | `Set<AutocaptureOption>` | `setOf(AutocaptureOption.SESSIONS)` | Which autocapture features are on. Requires 1.17.0 or later. |
| `interactionsOptions` | `InteractionsOptions` | Rage clicks and dead clicks on | Turns rage or dead click detection on or off when `FRUSTRATION_INTERACTIONS` is on. Requires 1.22.4 or later. |
| `trackingSessionEvents` | `Boolean` | `true` | Deprecated. Use `autocapture` with `SESSIONS`. |
| `defaultTracking` | `DefaultTrackingOptions` | Sessions only | Deprecated. Use `autocapture`. Setting it replaces the whole `autocapture` set. |

#### AutocaptureOption

| Value | Events | Notes |
| --- | --- | --- |
| `SESSIONS` | `session_start`, `session_end` | On by default. |
| `APP_LIFECYCLES` | `[Amplitude] Application Installed`, `Updated`, `Opened`, `Backgrounded` |  |
| `SCREEN_VIEWS` | `[Amplitude] Screen Viewed`, `[Amplitude] Fragment Viewed` | Fragment Viewed requires 1.18.0 or later. |
| `DEEP_LINKS` | `[Amplitude] Deep Link Opened` |  |
| `ELEMENT_INTERACTIONS` | `[Amplitude] Element Interacted` |  |
| `FRUSTRATION_INTERACTIONS` | `[Amplitude] Rage Click`, `[Amplitude] Dead Click` | Requires 1.22.0 or later. |

`AutocaptureOption.ALL` contains every value. Requires 1.22.4 or later. In Kotlin, build a set with `autocaptureOptions { +sessions; +screenViews }`; `addAll()` adds every value. For event properties, go to [Autocapture](https://amplitude.com/docs/sdks/analytics/android/android-kotlin-sdk/instrument-and-configure#autocapture).

#### InteractionsOptions

```kotlin
InteractionsOptions(
    rageClick: RageClickOptions = RageClickOptions(enabled = true),
    deadClick: DeadClickOptions = DeadClickOptions(enabled = true),
)
```

