You can use Alefonizer .. its lib displays Arabic characters on Android devices that do not support Arabic
here is a bunch
package org.alefon.com; import www.alefon.com.alefonizerArarbic.AlfnFixText; import www.alefon.com.alefonizerArarbic.AlfnLining; import android.app.Activity; import android.os.Bundle; import android.view.ViewTreeObserver; import android.view.ViewTreeObserver.OnGlobalLayoutListener; import android.widget.TextView; public class MainActivity extends Activity { private TextView tv; private AlfnFixText alfntx; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); alfntx = new AlfnFixText(true); tv = (TextView) findViewById(R.id.tx); String text = "قال ابن رشد:الله ليمكن ٔان يعطينا عقول ويعطينا شرأيع مخالفة لها"; tv.setText(text); ViewTreeObserver vto = tv.getViewTreeObserver(); vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() { @Override public void onGlobalLayout() { AlfnLining alflining = new AlfnLining(); String rlines = alflining.getTextLines(tv.getWidth(), tv.getPaint(), tv.getText().toString(), true); if (rlines != null) { String lli[] = rlines.split("\n"); String fn = ""; for (String st : lli) { try { st = alfntx.getFixedText(st); } catch (Exception e) { e.printStackTrace(); } fn += st + "\n"; } tv.setText(fn); } ViewTreeObserver obs = tv.getViewTreeObserver(); obs.removeGlobalOnLayoutListener(this); } }); } }
Just remember that you will need to use a font that contains an Arabic character and OTL for the Arabic language..ie Arial ..
====== update =======
Android studio uses UTF-8 as the file encoding .. but you can change it, see screenshot:

Good luck
Maher Abuthraa May 31 '13 at 10:04 2013-05-31 10:04
source share