2

I am developing an app that needs to retrieve the list of languages that are available in the device, in order to gather statistics. Basically, I would like to retrieve the list of languages that the user can see (and select) when accessing the Language and input->Language setting of the Settings app. I've tried several ways but don't seem to work:

This retrieves a list of locales, but some of them are not available in the device:

Locale[] locales = Locale.getAvailableLocales();

This works fine in my physical device but in the emulator does not retrieve some of the languages that are available:

String[] locales = Resources.getSystem().getAssets().getLocales();

This obtains the list of languages the user has chosen in the Settings app (API >= 24):

LocaleList locales = getResources().getConfiguration().getLocales();

Is there any way in which I could retrieve such list?

  • check out this link help you to find your solution [link](http://stackoverflow.com/questions/7973023/what-is-the-list-of-supported-languages-locales-on-android) – Himani Mehta Apr 26 '17 at 18:07
  • @himanimehta Thanks, but that link does not help, as it shows a list of languages supported by a given Android API version, not a list of the languages supported by the device (manufacturers often limit the default list of languages) – Manex Garaio Apr 27 '17 at 07:52
  • did you figure out ?? @ManexGaraio – Ramachandran A May 17 '18 at 13:26

0 Answers0