Another Android tutorial, driven by insomnia of having overdosed HPA Radix coffee.
Thank you Bro Ahmad Essam Naim, and Amr Gawish for providing the Arabic Reshaper class. The Java class is actually a library to reshape Arabic characters into connected forms. As we all know that Android 2.1 below do not support Arabic natively.
I’m assuming that you have the knowledge of Android apps development using Eclipse and already have the ADT installed.
STEP 1: Download the library at http://bar.amr-gawish.com/ .
After you have download and extract the file, you will have two files; ArabicReshaper.java, and ArabicUtilities.java . Copy both files in the src folder of your Android project.
More after the break… I’ll share on how to make use of the library.
STEP 2: Download the Arabic supporting font.
In order to do this tutorial in the Android environment, please download Arabic font such as dejavu font available at http://dejavu-fonts.org/wiki/Main_Page .
Extraxt the file and put the font inside assets folder of your Android project.
You should have your files inside the Project Explorer as shown in the Figure 1.
STEP 3: And this is the output.
These are the codes…
Code 1: arabicfont.java (just to display simple Unicode text in connected Arabic).
Code 2: ArabicReshaper.java
Code 3: ArabicUtilities.java
All the best…