I am getting Arabic text from server successfully. Retrieved text I want display in code but its showing boxes instead of Arabic text. Assume that t
array values are Arabic text from server.
string[] t={" "};
Textview tv = (Textview) findviewByid(R.id.text);
tv.setText(t[0]);
Android 2.1 does not have Arabic font.
Android 2.2 has Arabic font but does not show your word correctly.
Android 3.x supports Arabic completely.
For Android 2.1 you must set the typeface
Farsi.GetFarsiFont(this)
and then useFarsi.Convert("سلام")
For Android 2.2 you do not need setting font but must use
Farsi.Convert("سلام")
And for Android 3.x forget all of the above solutions ;). But you can change the font if you do not like the 3.x Arabic font.
so do the following steps:
1) At first add "TAHOMA.TTF" in assets folder
2) use the following class to get the font and converting your Arabic or Farsi text to a good form for showing in your activities.
3) And in your Activity:
enjoy!
my reference for Farsi class: Arabizer