I want to obtain only the available languages for my android application, i.e. those for which I have a folder named values- (e.g. values-en, values-fr) in res folder.
I do not want to store the language codes and I think to list all the sub folders of "res" of the form values-* and take the language code from their name. (eventually check if the code is in the array returned by Locale.getAvailableLocales() to be sure that it is correct). This idea is stated here How to get the available languages (Not all of them, just the languages available on my app).
I have tried using
getResources().getAssets().list("res"); getResources().getAssets().list("/res");
getResources().getAssets().list("/res/");
but none of them worked.
Do you have any idea how I can list the sub folders of "res" folder?
Thank you in advance.