Skip to Content

Android SDK

The native Android SDK is a modular Gradle build. Core does not pull DivKit; select the rendering modules only when the app uses them.

Requirements

  • Android API 23 or newer;
  • compile SDK 36;
  • Java 17;
  • an Engage app key beginning with eng_app_;
  • Firebase configured in the host application when using push.

Artifacts

ModuleArtifactPurpose
Coreengage-android-coreinstallation, profile, events, flags, preferences, privacy, sync
FCM pushengage-android-push-fcmFCM token lifecycle, notification processing, receipts
In-appengage-android-in-appschedules, local evaluation, DivKit overlays and placements
Message Centerengage-android-message-centerheadless inbox and mutations
Message Center UIengage-android-message-center-divkitready-made and embedded native DivKit UI

All artifacts in one Android release use the same version.

Repository and dependencies

// settings.gradle.kts dependencyResolutionManagement { repositories { google() mavenCentral() maven("https://jitpack.io") { content { includeGroup("com.github.mathias8dev.engage-android") } } } }
// app/build.gradle.kts dependencies { val engageVersion = "2.1.1" implementation("com.github.mathias8dev.engage-android:engage-android-core:$engageVersion") implementation("com.github.mathias8dev.engage-android:engage-android-push-fcm:$engageVersion") implementation("com.github.mathias8dev.engage-android:engage-android-in-app:$engageVersion") implementation("com.github.mathias8dev.engage-android:engage-android-message-center:$engageVersion") implementation("com.github.mathias8dev.engage-android:engage-android-message-center-divkit:$engageVersion") }

JitPack must be declared by the consuming application. Gradle does not inherit repositories from a library dependency.

Start during process creation

class ExampleApplication : Application() { override fun onCreate() { super.onCreate() Engage.start( this, EngageConfig( appKey = BuildConfig.ENGAGE_APP_KEY, logLevel = if (BuildConfig.DEBUG) EngageLogLevel.DEBUG else EngageLogLevel.INFO, ), ) } }
<application android:name=".ExampleApplication" ... />

Starting again with the same configuration is safe. A different app key or endpoint in the same process is rejected because durable state must not cross app identities. Optional modules activate through manifest-merged providers.

Keeping startup in Application.onCreate is essential for cold push: Android creates the application before dispatching an FCM message to Engage.

Preference Center

Available on the current develop branch and intended for the next Android release.

Present the default published center directly, or use typed display options to select a center and presentation context:

Engage.preferenceCenter.display() Engage.preferenceCenter.display( options = PreferenceCenterDisplayOptions( key = "marketing", localeLanguageTag = "fr-FR", ), )

The SDK Activity owns its close action and asynchronous choice writes. It follows the system appearance by default. Supply PreferenceCenterMaterialTheme for explicit Material semantic colors or localeLanguageTag to override the host locale. When no matching published center is available, the Activity renders an explicit unavailable state.

For an embedded or fully custom UI, observe Engage.preferenceCenter.center(key) and write changes through the subscription APIs described in Preferences, feature flags, and privacy.

Diagnostics

Observe Engage.state for startup status. Development logs use Logcat tag Engage and redact app keys, tokens, binding codes, attributes, and payload values.

Endpoint migration

Available on the current develop branch and intended for the next Android release.

Only when the same app release changes the Engage endpoint and upgrades old endpoint-scoped storage, declare the previous endpoint:

EngageConfig( appKey = BuildConfig.ENGAGE_APP_KEY, endpoint = URI.create(BuildConfig.ENGAGE_ENDPOINT), legacyEndpoints = listOf(URI.create(BuildConfig.PREVIOUS_ENGAGE_ENDPOINT)), )

Do not set legacyEndpoints for a normal upgrade with an unchanged endpoint.