Skip to main content

Stringboot provides multiple ways to access your strings, depending on your UI framework.

XML Layouts (Declarative)

For traditional Android Views, you can use the android:tag attribute to bind a view to a string key.
1

Add Tag

Add the android:tag attribute to your TextView:
2

Apply Tags

Call applyStringbootTags() in your Activity or Fragment:

Kotlin (Programmatic)

You can fetch strings programmatically using StringProvider.

Suspend Function

Use get() inside a coroutine for one-off fetching:

Reactive Flow

Use getFlow() to automatically update the UI when the string changes (e.g., language switch or remote update):

Jetpack Compose

For Jetpack Compose, use the rememberStringboot state or StringbootText composable (if available in your version).

Changing Language

To switch the language of the app at runtime:
StringProvider.setLocale updates the internal state. Reactive flows (Compose/Flow) will update automatically. For XML views, you must call applyStringbootTags() again.