How can i show Hindi text in Android Tablet
Asked Answered
S

3

6

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?

Sparid answered 17/10, 2011 at 5:48 Comment(1)
possible duplicate of How to show Hindi text in android?Quinquefid
D
4

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");
Dehiscent answered 17/10, 2011 at 5:52 Comment(8)
i downloaded vijyapati.ttf file and added to font folder in the assets but i am not getting Hindi font for my TextView i am getting only rectangle boxesSparid
By placing mangal.ttf i got Hindi font for TextView, thanks for your help Dr.nik is there any chance to get keyboard characters in Hindi...Sparid
#4478605Dehiscent
i am getting लॉगइन विवरण(Login Vivaran) as Login Vaviran in hidniSparid
i am asking is there any thing i have to add in my application to get exact Hindi fontSparid
some words are not displaying properly can any one suggest me the file(Hindi font f) which shows all words correctly in Hindi.Sparid
i think you need to change ttf fileDehiscent
i changed many ttf files but no luck if you know any ttf file name tell me i will trySparid
A
1

you can use Unicode ...for क ख

TextView tv=(TextView)findViewById(R.id.textViewmyView);

final Typeface tf = Typeface.createFromAsset(this.getAssets(), "Hindi-SARAL1.TTF");

tv.setText(Html.fromHtml("&# 2325;&# 2326;"));

tv.setTypeface(tf);

use Unicode value continues no gap....

this code is working for all alphabets of Hindi except.क्ष,त्र and ज्ञ for this you can use......

for क्ष:- tv.setText("9");

for त्र :- tv.setText("5");

and for ज्ञ:- tv.setText(")");

after that

tv.setTypeface(tf);
Ali answered 2/5, 2013 at 23:8 Comment(1)
It is not working from me when i m testing in emulators. But on real device it is working. Will it work for each device. ?Laskowski
T
0

On Android phones, if you install a Hindi (Devanagari) font - you will then see glyphs for the characters but the letters won't join up or form conjuncts properly, so all but the simplest text will be unreadable. This is due to the lack of proper complex text layout (CTL) or rendering support in Android phones - I don't know if the situation is better on Android tablets.

Sadly, Indic text doesn't even work properly in the Android 4.0 (ICS) emulator even though it was supposed to be fixed there.

Tangier answered 29/10, 2011 at 20:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.