androidhindi

Displaying non-English (specifically Hindi) characters on Android device


I have some Hindi text which is not getting displayed on the virtual device. The text is properly displayed in eclipse, and the files are utf-8 encoded.

E.g. I have this resource file:

        <?xml version="1.0" encoding="utf-8"?>
 <resources>

            <string name="hello">Hello World, Jain_aartisActivity!</string>
            <string name="app_name">जैन आरती संग्रेह</string>
     </resources>

But the AVD is unable to display the app_name. It just displays a small rectangle for each hindi character.


Solution

  • Try this ::

    here i have set hindi font in my textview. you can copy file in assets folder and apply following code :

    Typeface face;
    face = Typeface.createFromAsset(this.getAssets(), "fonts/hindi.TTF");
    tran_banner = (TextView) findViewById(R.id.tran_banner);
                tran_banner.setTypeface(face, Typeface.BOLD);