AI • Science • Technology • Future

Side Projects

Per-App Locales on Android: Real Challenges

Image from the original article
Featured image: original publisher image. Via original publisher.

Developers building Android apps often face challenges when localizing user interfaces. A developer shared their experience shipping a camera app in four languages: Korean, English, Japanese, and Chinese. Source: dev.to.

What Happened: Localizing a Camera App

The app, BboshaCam, is free with ads and runs on Android 7.0 and above. It offers four modes: Portrait, Photo, Landscape, and Night. Features include brightness, tone, skin, clarity, and animal filters like dog and cat.

Localization took more effort than the core camera functionality. The developer implemented per-app language support using Android’s locales_config.xml file and linked it in the app manifest.

  • Declared locales in locales_config.xml: ko, en, ja, zh-CN, zh-TW.
  • Set the application tag to use the locale config.

This makes the app appear in Settings > System > Languages > App languages. However, two key limitations remain.

Missing In-App Language Switch

Users cannot switch languages inside the app. The developer notes that Android 13 introduced per-app language settings, but no in-app switch exists.

For apps targeting versions below Android 13, the setting is invisible to users. To address this, the developer implemented a workaround using AppCompatDelegate.setApplicationLocales with AppCompat 1.6.0 or later. This allows the locale to persist across different Android versions and user sessions.

To ensure the selected language is applied before the first activity loads, the developer added a service in the manifest:

<service android:name="androidx.appcompat.app.AppLocalesMetadataHolderService" android:enabled="false" android:exported="false">
<meta-data android:name="autoStoreLocales" android:value="true" />
</service>

The developer explains that this setup ensures the user’s language choice is stored and applied at launch, even if the app is opened after a restart or update.

Camera-Specific Challenges

In a camera app, user actions are fast. Labels like ‘exposure’ or ‘hold still’ must be readable immediately after the shutter is pressed.

If a user sees labels in an unfamiliar language, the app becomes unusable—regardless of how well the photos turn out. Because of this, the language switch is placed on the first screen, where it is visible and accessible from the start.

CameraX use cases require the activity to be recreated during language switching. This can cause a preview to restart mid-session, which appears to users as a crash or app freeze.

The developer resolved this by storing mode and lens preferences in a ViewModel. This ensures that when the user switches languages, the app returns to the same settings—such as selected mode or lens—without disruption.

Image from the original article
original publisher image. Via original publisher. · Source

Store Listing vs. App Resources

Play Store listing locales—such as ko-KR, en-US, ja-JP, zh-TW, and zh-CN—are separate from the app’s internal resource locales. The developer’s app listing remains primarily in Korean.

A Chinese user sees a Korean title when they first encounter the app in the store, installs it, and then must navigate to an in-app switch to change the language. This creates a confusing and negative first impression, especially for users who expect the app to be in their native language from the outset.

The developer emphasizes that store listing localization should be prioritized early in the development cycle. It’s a low-cost, high-impact step that presents the app in a language users recognize before they even open it.

Strings Built Outside Activities

Dialogs, toasts, and notifications built from the application context do not automatically reflect the current app locale. The developer observed that without proper handling, these elements could display content in two languages simultaneously—such as a toast in English and a dialog in Korean—during a single session.

To prevent this, the developer implemented a helper function that routes every user-facing string through a consistent locale system. This ensures that all UI elements, regardless of where they are built, are displayed in the correct language.

One missed string could result in a jarring user experience—looking worse than simply having the app in English only. This highlights the importance of thorough testing and consistent localization across all app components.

For a student-led app development case, see How a Student Team Built a Financial Literacy App.

Learn about a silent detection system in A Dead-Man’s Switch That Reads Silence.

For a code-built app launch film, see App Launch Film Built Entirely in Code.

Learn about a student-built 3D anatomy atlas at A Student Built a Free 3D Anatomy Atlas.

The app is available on Google Play: https://play.google.com/store/apps/details?id=io.cho.bbocam&hl;=en.

Sources & further reading

Featured image: original publisher image. Via original publisher. Image source