Pergunta

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.

Foi útil?

Solução

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);

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top