I want to know that how can I display Urdu in TextView in Android. Urdu is stored on a server database which I got through JSON. any help about this will highly appreciated. Thanks
Asked
Active
Viewed 1,106 times
1 Answers
0
First make sure to save urdu in nvarchar datatype in database table. After that when you get JSON, copy it to any JSON Formatter and you should be able to read it as urdu. This is just for confirmation that you are getting it from server as urdu. Now just set it to TextView as text.
if you want to set any custom font, download .ttf file, copy to fonts directory and then set it as typeface as below.
Typeface urdu = _context.getResources().getFont(R.font.your_file_name);
_tv.setTypeface(urdu);
You can also set fonts in xml
https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml

Zeeshan Badshah
- 65
- 1
- 8