Skip to documentation
DocumentationSDKs and frameworks

Android

Use ReRune with native Android resources in Compose or Views, including explicit refresh when published text changes.

Documented SDK 1.2.0

Requirements: Android API 21+, Kotlin or Java

Package reference
On this page

Choose Compose or Views

Gradle Kotlin DSL · choose the UI module

dependencies {
  // Compose
  implementation("io.rerune:rerune-android-compose:1.2.0")
  // Views
  implementation("io.rerune:rerune-android-views:1.2.0")
}

android {
  packaging.resources {
    merges += "META-INF/LICENSE"
    excludes -= "/META-INF/LICENSE"
  }
}

Choose the Compose or Views dependency for your app module and enable Maven Central. Keep native strings.xml and plural resources. Merge META-INF/LICENSE from the SDK artifacts as shown below; remove a conflicting exclusion if your project has one. The public runnable examples use the same 1.2.0 SDK release.

Connect the Android application

  1. Initialize ReRune.setup in the Application with the project read-only OTA Publish ID.
  2. Wrap the activity base context with newBase.reRune() so native resource lookup can resolve delivered strings.
  3. For Views, install ReRuneViews in the Application and rebind existing widget text when strings update.
  4. For Compose, observe localization revisions around the UI that reads native string or plural resources.

The runnable examples show the complete Application and Activity wiring. Compose uses reRuneObserveRevision; Views uses reRuneOnStringsUpdated with a lifecycle scope. Copy the setup for your SDK version together with its imports and lifecycle handling.

The fragments below belong in your existing Application and Activity. Register the Application class in AndroidManifest.xml. For Views, install the integration in Application.onCreate and add the update listener after view binding is initialized. Replace binding.title and R.string.title with your actual view and resource. SDK imports use rerune.ReRune and rerune.reRune; UI hooks are in rerune.compose and rerune.views.

Kotlin · Application.onCreate, after super.onCreate()

ReRune.setup(
  app = this,
  otaPublishId = "<READ_ONLY_OTA_PUBLISH_ID>",
)

Kotlin · Activity base context

override fun attachBaseContext(newBase: Context) {
  super.attachBaseContext(newBase.reRune())
}

Kotlin · inside a Compose screen

reRuneObserveRevision {
  Text(text = stringResource(R.string.title))
}

Kotlin · Application.onCreate, Views only

ReRuneViews.install(this)

Kotlin · Activity.onCreate, after initializing view binding

binding.title.text = getString(R.string.title)
reRuneOnStringsUpdated(lifecycleScope) {
  binding.title.text = getString(R.string.title)
}

Native resources and runtime languages

Continue using native resource identifiers in application code. Keep bundled resources for offline fallback and ensure quantity arguments match your plural resources. Rebind or recompose existing UI after an update; fetching data alone does not rewrite text already assigned to a widget.

Dashboard-managed languages can appear after a successful fetch. Use runtime locale availability for an in-app picker. On Android 14 and newer, the SDK can also update the system per-app language list through LocaleConfig. New resource IDs, application code, and store metadata still require their normal release or store update.

Verify delivery on a device

  1. Start with local resources and confirm the app renders without a network connection.
  2. Publish a changed value for an existing key and use the correct project OTA ID.
  3. Trigger an update check and confirm both newly created and already visible UI display the expected text.
  4. Restart offline after a successful fetch to check cache restoration.