Skip to content

Android SDK

The Monita Android SDK observes the vendor traffic leaving your app — currently Meta (Facebook), Google Firebase, Adobe Analytics and Google Ads — and streams it to the same property dashboards, detectors and alerts as your web traffic.

Create a property with source type Mobile app (or reuse an existing property if you want web and app traffic together), configure your vendors, and copy the SDK token from Manage → Installation guide. See the Monita-side setup for vendor configuration.

  1. Add JitPack to your root settings.gradle.kts:

    dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
    mavenCentral()
    maven { url = uri("https://jitpack.io") }
    }
    }
  2. Add the SDK and adapter library to your module-level build.gradle.kts:

    dependencies {
    implementation("com.github.rnadigital.monita-android-sdk:monita-android-sdk:v1.10.0")
    implementation("com.github.rnadigital.monita-android-sdk:monita-adapter-library:v1.10.0")
    byteBuddy("com.github.rnadigital.monita-android-sdk:monita-adapter-library:v1.10.0")
    }
  3. Add the Byte Buddy Gradle plugin (it wires the SDK’s interception into your build):

    plugins {
    id("net.bytebuddy.byte-buddy-gradle-plugin") version "1.15.5"
    }
  4. Sync the project (Sync Now in Android Studio, or ./gradlew build).

  5. Initialize the SDK in your Application class:

    import android.app.Application
    import com.rnadigital.monita_android_sdk.MonitaSDK
    class MyApplication : Application() {
    override fun onCreate() {
    super.onCreate()
    MonitaSDK.Builder(this)
    .enableLogger(true) // verbose logging during rollout; disable for release
    .setToken("<your SDK token>")
    .setBatchSize(10)
    .setCustomerId("123456") // joins app events to your customer IDs
    .setConsentString("Granted") // your consent state — feeds compliance reporting
    .setSessionId("123456") // joins app events into sessions
    .setAppVersion("1.0")
    .build {
    // Initialization complete
    }
    }
    }
  1. Run the app with enableLogger(true) and watch Logcat for Monita upload logs returning 204.
  2. Fire a monitored vendor event (e.g. a Firebase log event) and check the property’s Visualisation view in the app — events appear within a minute or two.