Resources and Qualifiers

Resources: strings, colors, dimens and Qualifiers

Everything under res/ is a resource, compiled into an ID in the generated R class (R.string.share) and resolved at run time against the device's configuration. A directory with a qualifier suffix supplies alternatives under the same names: values-fr/ for French, values-night/ for the dark theme.

Default resources with French and night overrides (res/values*/, excerpts)XML
<!-- values/strings.xml -->
  <string name="catalog_title">Catalog</string>
<!-- values-fr/strings.xml -->
  <string name="catalog_title">Catalogue</string>
<!-- values/colors.xml, then values-night/colors.xml -->
  <color name="page">#FFF8F0</color>          <!-- warm paper -->
  <color name="page">#1E1A17</color>          <!-- same names, night values -->

Compose 234 reads them with stringResource(), pluralStringResource() and colorResource(). cmd uimode flips night mode, and cmd locale sets a per-app language (Android 13+):

Switching the emulator to night mode and BookNest to FrenchShell
adb shell cmd uimode night yes
adb shell cmd locale set-app-locales com.example.booknest --locales fr-FR
adb shell cmd locale get-app-locales com.example.booknest
Output
Night mode: yes
Locales for com.example.booknest for user 0 are [fr-FR]
The catalog after both commands: values-fr and values-night win
The catalog after both commands: values-fr and values-night win

Qualifiers follow a fixed order (drawable-night-hdpi, not drawable-hdpi-night). Use %1$s arguments and <plurals>, since languages reorder words and differ in plural forms.