Installation
Use 1.1.0-beta.2 for controlled integration testing. Android API 21+ and Kotlin 1.9+ are required. The old 1.0.0 release predates the analytics and privacy fixes.
Add the SDK
In settings.gradle.kts:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven {
url = uri("https://jitpack.io")
content { includeGroup("com.github.AttributeHQ") }
}
}
}In the app module’s build.gradle.kts:
dependencies {
implementation("com.github.AttributeHQ:android-sdk:1.1.0-beta.2")
}Initialize
Create an Android app in AttributeHQ with your package name. Use its dashboard UUID and a write-only SDK key. Never embed a dashboard credential or server conversion key.
import android.app.Application
import com.attributehq.sdk.AttributeHQ
import com.attributehq.sdk.AttributeHQConfiguration
class MyApp : Application() {
override fun onCreate() {
super.onCreate()
AttributeHQ.initialize(this, AttributeHQConfiguration(
apiKey = "ak_your_write_only_sdk_key",
appId = "your-dashboard-app-uuid"
))
}
}Register .MyApp as android:name on your manifest’s application element. Leave debug logging off outside debugging.
Configuration
| Option | Type | Default | Meaning |
|---|---|---|---|
apiKey | String | Required | Write-only SDK key |
appId | String | Required | Dashboard app UUID |
batchSize | Int | 10 | Events per batch; clamped to 1–100 |
flushIntervalSeconds | Long | 5 | Flush interval; minimum 1 second |
maxQueueSize | Int | 100 | Queue capacity; minimum 10 |
enableDebugLogging | Boolean | false | Diagnostic logging |
requestTimeoutMs | Long | 30000 | Network timeout; minimum 5000 ms |
initialCollectionEnabled | Boolean? | null | Preserve saved choice; new installations default to enabled |
initialAdvertisingSharing | AdvertisingSharing? | null | Preserve saved choice; new installations start unknown |
enableSandboxEvidenceUpload | Boolean | false | Opt in to sandbox permission observations |
initialApplicationTrackingEnabled | Boolean? | null | Preserve app-level decision; new installations default to false |
Explicit initial choices replace saved choices on every initialization. Avoid hardcoding an enabled choice if a user may have withdrawn it. See privacy controls.
Permissions and dependencies
The SDK manifest contributes android.permission.INTERNET and android.permission.ACCESS_NETWORK_STATE. It does not declare AD_ID or collect GAID/Android ID.
Gradle resolves Kotlin stdlib, Install Referrer 2.2, lifecycle-process 2.7.0 and core-ktx 1.12.0. Consumer ProGuard rules are included automatically.
Upgrade
Beta.1 app-scoped installation identity is retained. Older unscoped development storage is not migrated; upgrading from those builds creates a new installation identity without replaying their old queue. Test upgrades in an isolated app first.
Release notes describe validation and remaining limits. Android partner delivery remains disabled.