Monday, July 19, 2010

How To Setup Hebrew Font in Android Emulator.

This tutorial will guide how to set up Hebrew Fonts on your emulator.

1) Download Hebrew fonts for Android. You can download it with this link.

2) extract it to C:\fonts directory. You can copy it to any other folder but we will use this path in our tutorial.

Let's consider that our Android SDK installed in "C:\Android\android-sdk-windows" home directory.

3) Run C:\Android\android-sdk-windows\tools\android.bat and create new Virtual Device and name it my_avd2 and add the following settings.

4) Click on "Create AVD" button and create virtual device.

When you create new virtual device it's files will be created under C:\Users\[%USERNAME%]\.android\avd with the folder names as virtual Device. in our case my_avd2

Every SDK version mapped to its platforms folder:

Android 2.2 = android-8
Android 2.1 = android-7
Android 1.6 = android-4
Android 1.5 = android-3

In our example our Virtual Device uses Android 2.1 and it is mapped to android-7 folder accordingly.

5) Copy C:\Android\android-sdk-windows\platforms\android-7\images\system.img to C:\Users\[%USERNAME%]\.android\avd\my_avd2 folder

6) Go to C:\Android\android-sdk-windows\tools folder and start your Virtual device using the following command:
emulator.exe -partition-size 128 -avd my_avd2

7) After emulator starts up and you see Unlock phone window using adb.exe utility push fonts file into virtual device partition using the following commands:

adb remount
adb push c:\fonts\DroidSansFallback.ttf /system/fonts
adb push c:\fonts\DroidSansMono.ttf /system/fonts
adb push c:\fonts\DroidSans-Bold.ttf /system/fonts
adb push c:\fonts\DroidSerif-Bold.ttf /system/fonts
adb push c:\fonts\DroidSans.ttf /system/fonts
adb push c:\fonts\DroidSerif-BoldItalic.ttf /system/fonts
adb push c:\fonts\DroidSerif-Italic.ttf /system/fonts
adb push c:\fonts\DroidSerif-Regular.ttf /system/fonts

8) After the script done, you close emulator.

9) start AVD Manager using android.exe command.

10) select my_avd2 device and click on start button. After emulator starts unlock phone and click on browser. Hebrew google page appears.

Now let's install Hebrew Keyboard.

11) Download AnySoftKeyboard and AnySoftKeyBoard Hebrew all other version s can be downloaded from this code project

12) extract both files to c:\temp directory.

13) run the following command in order to install packages.
adb.exe install c:\temp\AnySoftKeyboard_20100718.apk
adb.exe install c:\temp\AnySoftKeyboardLanguagePackHebrew_20100629.apk

14) On the phone go to Setting -> Language & Keyboard.

15) Select and check AnySoftKeyBoard and go to AnysoftKeyBoard settings.

16) Go to Keyboards and check Hebrew KeyBoard.


P.S: By The way this method can be used to install any other third party font like Thai for example.

No comments:

Post a Comment