1

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.

Cœur
  • 34,719
  • 24
  • 185
  • 251
morpheus
  • 17,135
  • 21
  • 84
  • 151

2 Answers2

1

I don't believe that the default fonts on Android devices contain hindi characters. You'll need to package up a hindi font with your app and use that.

Ben Clayton
  • 78,728
  • 25
  • 118
  • 125
1

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);
Nikunj Patel
  • 21,388
  • 23
  • 87
  • 131
  • 2
    I have tried this, but it doesn't seem to work. I downloaded two files from the web hindi.ttf and droidsansfallback.ttf. Do you have a link to your hindi.ttf? – morpheus Dec 23 '11 at 06:00