Location-specific images in Android App

I created an Android Application that displays a number of images that also contain text. As I want to publish my App on the Play Store and make it available for users in all countries of the world, I am trying to include location-specific images that contain text in different languages. Depending on the location of the user, the correct image should be displayed. How is it possible to implement this behavior in Android Studio?
1 answer

Use Locale in Android Application

I assume that your images are stored in the folder res-drawable. In Android Studio, location-specific behavior can be achieved by right-clicking on res and creating a new Android resource directory. In the following pop-up window, different qualifiers can be set, e.g. the Locale that allows will read out the language that is set on the mobile phone of the user and automatically uses the image from the corresponding directory (see the attached picture for details). You will notice that Android Studio creates the new directory with a specific suffix, e.g. "drawable-de" for german images. The general "drawable" folder will be used in case that the Locale of the user does not match any of your specified qualifiers and can therefore be seen as a default case.

Taggings: