Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i show Hindi text in Android Tablet

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?

like image 401
Kiran_b Avatar asked Oct 17 '11 05:10

Kiran_b


1 Answers

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");
like image 91
Nikunj Patel Avatar answered Sep 22 '22 16:09

Nikunj Patel