Hi I want to pass installed Apps name to server for this I am using getApplicationLabel but server does not accept other than english character ,so I want to know whether getApplicationLabel (ApplicationInfo info) returns only English character or it may return non english character (like Chinese, hindi )?
No, it won't only return Latin characters.
There are at least two ways it won't.
If the app is only localized for a non-Latin alphabet, say some obscure Indian or Chinese app. The application probably isn't named using the basic Latin alphabet.
If the app is localized for many languages and the current device language is using a non-Latin script, such as Google Chrome. On a device with the language set to Chinese, getApplicationLabel() would likely return "谷歌浏览器".
Related
I have an issue with Serbian Cyrillic language in my app which have 14 different languages. Russian Cyrillic is working just fine.
For example, if user set the app to work in Serbian language, therefore strings.xml from values-sr should be read. And it does. However, output is in equivalent Latin script.
For example, in strings.xml there is a word:
<string name="Password"><DATA><![CDATA[Лозинка]]></DATA></string>
R.string.Password should display Лозинка but instead it is displaying transliterated word as Lozinka... all characters changed to Latin equivalents.
I have tried this on my Mate 20 Pro device. However, on Android simulator in all software versions is working just fine.
Any idea?
It's a bug specific to some Huawei models. If you set Serbian(Latin) as language in the phone settings, it transliterate all Cyrillic string resources to Latin. It also messes up other Cyrillic languages defined as string resources.
I translate my apps to Portuguese language. After users asking for Portuguese translation despite it's already translated, i can see it's translated when i change my device's language to Portuguese, i thought maybe i need to pt-rBR folder, but it does not help either.
I asked users to send their device language, image or screenshot of the app, but after multiple tries and few weeks none of them replied back.
Does anyone experience the same issue with Portuguese? I really can't figure out why it happens, i tried on 3 devices and both work fine. I also translated to Spanish, and Spanish is spoken in various countries too, haven't got any issues.
All the Portuguese strings (works for other resources too) should go to values-pt/strings.xml you should only use values-pt-rPT and values-pt-rBR if you have specific localizations for Portugal and Brazil respectively, otherwise (and in terms of simple localizations) they should share most elements.
Spanish is the same, you have values-es and then values-es-rES for Spain specifically, but various other Spanish-speaking countries, e.g.: values-es-rAR for Argentina and so forth.
French: values-fr or values-fr-rCA for Canada, etc.
Source: https://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources
The language is defined by a two-letter ISO 639-1 language code, optionally followed by a two letter ISO 3166-1-alpha-2 region code (preceded by lowercase "r").
I have a problem in Android Programming.I need to post non-English character to server and get non-English character from server in my android code and when I try to do this I face with some characters like " ااننننتبو". anybody can help me?
here is codes for post data :
String data=URLEncoder.encode("username","UTF-8")+"="+URLEncoder.encode(User,"UTF-8");
data+="&"+URLEncoder.encode("matn","UTF-8")+"="+URLEncoder.encode(Matn,"UTF-8");
data+="&"+URLEncoder.encode("status","UTF-8")+"="+URLEncoder.encode(Status,"UTF-8");
If you want your app to support multi-language, you need to have corresponding locale strings available in xml/strings files...
If it is just a few characters like font icons, you can store them in strings resource file.
Check your device whether the language is installed, or try using
Html.fromHtml( "<html><body>"+response+"</body></html>");
I have some Android applications about finance (prices and some calculations). What is the right way to show the finance data for Arabic localization? Formatted as Arabic numbers or "Latin" (١٢٣٤٥٦٧٨ or 12345678)?
Usually I format all the numbers to user locale, but uninstall rate for Arabic locale is way too high compared to other localizations (except Saudi Arabia). Also I've noticed that many of the developers from Arab countries (on Google Play) do not format the numbers.
Formatting numbers in Arabic Locale (١٢٣٤٥٦٧٨) is considered "going for the extra mile" and will be mostly appreciated by Arabic natives. Native Arabic speakers will certainly notice the product is extremely localized to their needs (in your case financial markets) and you have taken them into consideration.
Nevertheless, you need to consider copy-and-paste and form filling (mostly they are already taken care of by the OS). e.g. copying the number "١٢٣٤٥٦٧٨ " shall copy 12345678 to make sure compatibility with other apps. Also, Regular Expressions in forms shall consider the Arabic numbers.
PS, make sure the translation is perfect :)
I am trying to develop a app for my country's elderly. In a multi-racial country, i need to detect voice for English and Chinese(for now). I am having some problems with comparing the output, which is in chinese, to a Chinese unicode or character.
for example if the voice recognised 救命(help), which would be a right way to compare?
Currently I am using this.
if(d[i] .equals("help") || d[i] .equals("救命"))
sadly it doesn't work. Any help here guys?
You've encoded your Chinese characters using HTML encoding, which is inappropriate for Java source code. Try:
if(d[i] .equals("help") || d[i] .equals("\u6551\u547d"))
See section 3.3 Unicode Escapes of the Java Language Specification for complete information.