I just found a nice tutorial that will help me implement an easy user guide system in my application, as I will be able to draw it with any plain old HTML editor.
My question is simple: since all resources are localizable, I can easily translate my application into new languages. What about assets? Is there an automatic localization mechanism? I don’t think so.
How do I retrieve system locale in order to construct a localized URL when loading the help page’s HTML file? Is there some call to retrieve display size/density the same as coded in the resources world (ie. public String getDensity() returns “xhdpi”, “ldpi”…)?
Danke 😉
If you really need to check current system locale, one simple way to do it is to add an identifier string in your strings.xml files.
For example, in values/strings.xml, add:
in values-es/strings.xml, add:
in values-fr/strings.xml, add:
and so on. Then you’ll be able to check current language programmatically with something like this (to be improved of course, just as an example):
I hope this helps you.