Question

Quick question: Can I use the Myanmar Language in an Android App? I guess the bigger question here is about unicode in general but I don't know what to ask about that.

Was it helpful?

Solution 3

Language support comes in two stages:

  1. The device needs to be able to print the languages' characters. Android has full UTF-8 support. This means you can print Strings in any language on the screen. BUT: Not all characters supported by the system are included in the default fonts. E.g. Tamil fonts are available, Sinhalese fonts are not.

  2. Android official language support allows you to set the phones locale to whatever is available. The list of available locales is linked in the other answer. Being on that list means: the user can set the language of the app and the whole system. And you can have folders like res/values-de to show locale specific strings.

To test 1., you just need to open the phone's browser and look one a website in that language. Check if the characters are shown or if you only see [] or just nothing.

To test 2., you need to check the android source code or some official documentation.

BUT, there is something in between:

If you see the characters but it is still not an official locale you can do the following:

Add resources for your language anyway: res/values-whatever and allow the user to choose the custom locale in the app's settings. If the user has chosen whatever you can set the locale in EVERY Activity before doing anything else.

OTHER TIPS

Start from Android 4.3 , you can use Myanmar language in the app. Myanmar unicode has no more problem. However, Android still not support Myanmar language in default.

You can use Zawgyi or Unicode correctly in Android 4.3

You can use ttf font with @Ye Lin Aung mention

tv_mm3 = (TextView) findViewById(R.id.tv_mm3);
Typeface tf_mm3 = Typeface.createFromAsset(getAssets(), "fonts/mm3.ttf");
tv_mm3.setTypeface(tf_mm3);

For web, ttf font embed can't work. You need to use svg for Zawgyi. However, unicode ttf font can't work in android 4.3. It can't render after convert svg font. So, default webview with unicode is possible now.

for WebView , you need to put zawgyi svg font under the asset folder.

@font-face {
    font-family:'Zawgyi-One';
    src:url('file:///android_asset/fonts/zawgyi.svg');
}

If you want to use unicode in webview , you can use chromeview from https://github.com/pwnall/chromeview

I hope, my answer is useful for you.

Update:: Android 4.4 support Myanmar unicode and zawgyi show well on app and webview.

Disclaimer : I am a developer from Myanamr.

Yes. You can but it's not fully supported yet, IMHO. You can embed the font by using typeface. You have to put your desire font in the assets folder first. Something like this will work.

tv_mm3 = (TextView) findViewById(R.id.tv_mm3);
Typeface tf_mm3 = Typeface.createFromAsset(getAssets(), "fonts/mm3.ttf");
tv_mm3.setTypeface(tf_mm3);

Slightly off topic, but I suggest you to try with a few fonts (either Unicode fonts or not). The rendering will be incorrect depends on the Android API version.

On latest API version 4.3, the Myanmar texts with Unicode fonts are rendered correctly on the TextView. I think it's enough for most of the applications. My suggestion is to use Myanmar3 Unicode font.

Here you can find a large list of supported languages with the localisation code:

What is the list of supported languages/locales on Android?

Below is an Android tutorial for supporting different languages in android app....

http://developer.android.com/training/basics/supporting-devices/languages.html

Hope this will help you.

Android 4.4+ has full Myanmar support including fonts. Informative article at http://viss.wordpress.com/2013/11/16/the-state-of-burmese-unicode/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top