How can i show Hindi text in Android Tablet

Kiran_b picture Kiran_b · Oct 17, 2011 · Viewed 8.1k times · Source

I am developing an application in Android Tablet. Now in my application, I want to show Hindi text for all EditText and Buttons and also I need to get data from Oracle database and need to store in Sqlite.

I know how to save and retrieve data from Sqlite but the only thing needs to show Hindi Text in android.

I already checked How to show Hindi text in android? but need to know clearly what should I have to save in assets and values folder i.e. Hindi font.

Some words are not displaying properly. Can anyone suggest me the file(Hindi font) which shows all words correctly in Hindi?

Answer

Nikunj Patel picture Nikunj Patel · Oct 17, 2011

your custom apps you will most probably want to use your own font. This post will show you how you can do so. This is a simple example... create a folder in the root of your project called assets/fonts/ then paste the TTF font file (in this case Verdana.ttf). Then, if you want to apply that font to, say a TextView, do the following

TextView im = (TextView ) findViewById(R.id.im);
Typeface face=Typeface.createFromAsset(getAssets(),
                                          "fonts/hindi.ttf");
        im.setTypeface(face);
        im.setText("Hindi font");