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 value
I would like to add my experience after struggling several weeks with Arabic, Actually this post was veryhelpful me when I use arabic fonts in my android application.
I used farsi class to rearrang text. But it is not up to my expectations. because, customer is always too much consider about every letter of the application and it is arrangment.
In the farsi class, one problem is it can't rearrange closing brackets properly. Like that I noticed several issues.
However when I use ArabicUtility class, I noticed that it has improved text rendering better than Farsi class. https://github.com/agawish/Better-Arabic-Reshaper/commits/master
please not that you have to install fonts in assests folder and you can change font type from this class. Additionally I have added a new method to above class in order to get text from string filles and set text to textviews.
here is the code for that.
public void addTranslate(int rid, TextView txt1, Context context) {
String textv = context.getResources().getString(rid);
txt1.setText(ArabicUtilities.reshapeSentence(textv));
}
using above method in your activities, you just have to pass above three parameters.