Install the SDK
This page adds the Grona Android SDK to your app’s Gradle build. Do it once per app module that shows Grona content. When the build syncs, go on to initialise the SDK.
Requirements
Section titled “Requirements”Check these before you add the dependency. The SDK’s build metadata enforces the first two, so a project that misses them fails to build instead of failing at runtime.
| Requirement | Value | Notes |
|---|---|---|
| Minimum Android version | Android 7.0 (API level 24) | Your app’s minSdk must be 24 or higher. |
compileSdk |
36 or higher | The AAR metadata sets minCompileSdk = 36. A lower compileSdk fails the checkAarMetadata task. Use an Android Gradle Plugin version that supports API 36. |
| Java bytecode | Java 11 | The SDK is compiled to Java 11 bytecode. Set your app’s compileOptions and Kotlin jvmTarget to 11 or higher. |
| Kotlin | 2.1 or later | Only if your app uses Kotlin. The SDK is compiled with Kotlin language and API version 2.1 and declares Kotlin standard library 2.1.0, so it does not force a newer Kotlin on you. |
| UI toolkit | Android Views | GronaSlotView is a FrameLayout. The SDK has no Jetpack Compose API in version 0.1.0. |
| Permissions | android.permission.INTERNET |
Declared in the SDK’s manifest and merged into yours. The SDK declares no other permission. |
The SDK’s only runtime dependencies are the Kotlin standard library and kotlinx-coroutines-android. It brings no AndroidX libraries and no HTTP client.
Add the dependency
Section titled “Add the dependency”The SDK ships as two artifacts on Maven Central:
| Artifact | Configuration | Purpose |
|---|---|---|
ai.grona:grona-core:0.1.0 |
implementation |
The SDK. |
ai.grona:grona-debug:0.1.0 |
debugImplementation only |
A debug screen for your own debug builds. See Test and debug. |
-
Make sure Maven Central is one of your repositories. New Android projects list it in
settings.gradle.kts:settings.gradle.kts dependencyResolutionManagement {repositories {google()mavenCentral()}} -
Add the two artifacts to your app module. Use the version catalogue if your project has one.
gradle/libs.versions.toml [versions]grona = "0.1.0"[libraries]grona-core = { module = "ai.grona:grona-core", version.ref = "grona" }grona-debug = { module = "ai.grona:grona-debug", version.ref = "grona" }app/build.gradle.kts dependencies {implementation(libs.grona.core)debugImplementation(libs.grona.debug)}app/build.gradle.kts dependencies {implementation("ai.grona:grona-core:0.1.0")debugImplementation("ai.grona:grona-debug:0.1.0")} -
Check the module’s Java and Kotlin targets meet the requirements above:
app/build.gradle.kts import org.jetbrains.kotlin.gradle.dsl.JvmTargetandroid {compileSdk = 36defaultConfig {minSdk = 24}compileOptions {sourceCompatibility = JavaVersion.VERSION_11targetCompatibility = JavaVersion.VERSION_11}}kotlin {compilerOptions {jvmTarget.set(JvmTarget.JVM_11)}}Higher values, such as Java 17, are fine.
-
Sync Gradle and build the app once. If
checkAarMetadatafails, raisecompileSdkto 36.
What the SDK adds to your app
Section titled “What the SDK adds to your app”- One permission:
INTERNET, for the signed configuration, events, preview pairing and campaign images from your allowed https hosts. - No R8 rules. The SDK’s consumer rules file is empty and your app needs no extra rules. See R8 and ProGuard.
- Resources prefixed
grona_. The debug artifact’s resources usegrona_debug_. - One activity, from
grona-debugonly. It is not exported and has no intent filters.
The SDK never reads the advertising ID, OAID, ANDROID_ID or App Set ID. For what it sends and when, see Google Play Data safety.
Next steps
Section titled “Next steps”- Initialise the SDK from your
Applicationclass. - Read Rendering modes to decide where Grona draws and where your app draws.