AlvaroSantisteban
AlvaroSantisteban

Reputation: 5336

Resource directory specific to a region (not a locale)

Is it possible to create an Android Resource Directory that is only specific to a region?

In Android, if you want to make a Resource Directory specific to a locale, you name it in the following manner values-de (German locale), and if you want it to be specific to a locale and region you name it like values-de-rAT (German locale with Austrian region). In my case, I do not care about the locale and only about the region, but the following values-rAT does not seem to be valid.

I know that I can get the region in code with getLocales(resources.configuration).get(0).country but I was wondering if there is a way to work with resource directories too.

Upvotes: 2

Views: 245

Answers (1)

Saurabh Thorat
Saurabh Thorat

Reputation: 20634

You can create resources for a country by using the country code qualifier: MCC or MNC. For example, mcc310 is U.S. on any carrier

Here's the link: https://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources

enter image description here

Upvotes: 2

Related Questions