Arabic text support for Android Emulator - android-emulator

I would like to display Arabic text in my Android application. I am developing the application for Android 1.6.
Problem is, when i run the application i can only see square boxes instead of Arabic text.
After google'ing i found the font(*.ttf -true type font) for Arabic has to be added.
[ http://www.mydigitallife.info/2010/07/02/how-to-install-and-add-hebrew-arabic-and-unsupported-language-fonts-to-android-phone/ ]. But the solution is for real devices. More over in emulator most of the commands [ex: su,mkdir,chmod etc] are not permitted.
I'm working on windows XP, Eclipse 3.5.2, Android 1.6. All i need is a solution to display Arabic text in emulator.
Any of your effort in this regard is respected from my side:-)

I've got solution from my friend for the above said prob..
And sharing the same here..
If you are having .ttf file then first of all open your project in eclipse and copy .ttf file into the assets folder, which will be in your project hierarchy.
and then open .java file where you want to use that font and just follow these steps:-
First
Typeface font1;
TextView txt1;
EditText edtxt;
Second:
In onCreate Method just write down this code.
/*here fonttype.ttf is the file which was copied in assets folder.*/
font1 =Typeface.createFromAsset(getAssets(),"fonttype.ttf");
txt1 =(TextView) findViewById(R.id.user_id_txt);
txt1.setTypeface(font1);
edtx = (EditText) findViewById(R.id.editText);
edtx.setTypeface(font1);
by this your problem will solve.
All credits goes to my friend

you can save the XML file in the UTF-8 format

Related

Xcode Kurdish localization issue

I have a localized Kurdish text in google sheet when I copy the text from the sheet to the localization files, Kurdish characters are looking weird.
From the sheet:
From Xcode:
I tried to use Kurdish fonts maybe it will fix the issue but it didn't work
More Updates:
If I use Kurdish (ku) the file text looks fine, and if I use Central Kurdish (ckb, ckb-IQ, ckb-IR) the text is not fine
Any suggestion what should I do?

install4j change content of a Button

I have a install4j Project. It wprks fine but i found a little Error and dont know how to fix it.
In my Project i saw that on the File Chooser Window the Buttons are in two languages. I want German and the whole Project is set to German.
How can i chance that the content of 1. Button is German and the 2. is english? i did not found any option in screen configuration
thx
This is a bug, it will be fixed in 7.0.5. You can contact support#ej-technologies.com to get a build where this is already fixed.
As a temporary workaround, define the i18n message ButtonSelect in a custom localization file on the "General Settings->Languages" step and set it to the German text.

How To Display "Chinese" Character Comments And Strings In Eclipse

The android project was compiled under Windows. When I import the project in eclipse under Mac, the comments and hardcoded strings, which is supposed to be displayed in Chinese, were all displayed as garbages.
See screenshot below:
Is there a way to solve this? Please help. Many Thanks!
As you are putting text as hardcoded please input that text in the string.xml
Change file encoding. Open file in editor. Click File > Properties and change encoding. Try UTF-8 or UTF-16

iphone sdk Localizable.strings files displaying incorrecting in xcode 4.1 after upgrading

After upgrading to iphone xcode 4.1 build 4B110F all of my localizable.strings files are showing up as gibberish in the xcode editor. I created these files using UTF-16. I can not find a way to tell the editor that they are UTF-16. I am able to view the Localizable.strings files by viewing as a property list, but if I view them as Source Code, I see gibberish. I like to translate the entire localization.strings file and paste it into the editor. I don't want to have to cut and paste one line at a time in the property editor. There should be some way to tell xcode to show the file as UTF-16. Does anyone have any ideas?
I tried removing the files and re-adding them. I used to get prompted for the UTF type, but it does not do this any more.
You can find the text encoding setting for a file in the Utility area of Xcode 4.1. The utility area is the right-handside lateral area.
In the utility area, look for and select the first pane, named "File Inspector".
There, you will find the text encoding in the "Text Settings" block. Expand if necessary using the triangle.
I had this same problem. I was able to work around it (without much actual investigation) by simply opening the previous string files in TextWrangler, then copy from TextWrangler and paste into XCode4's view of the string file. Things seem to be working fine as a result.
To fix XCode 4.1 UTF-16 encoding issues:
1: Open the file you want to change
2: Put your cursor into the file, which will give the editor focus (VERY IMPORTANT).
3: Proceed to look under the Utilities Pane (very far right) for Text Settings and use the Text Encoding drop down to select UTF-16 or whatever other encoding you want.
If you forget step 2, and only highlight the file in the Project Navigator, you will not see encoding options.

How to change text encoding of Localizable.strings file in Xcode 4?

I am learning how to localize the strings in my project and I am using Xcode 4.
I have generated the base Localizable.strings file, and I want to import this file, changing its encoding from utf-16 to Unicode utf-16 so that the text in the file is readable within xCode. If I strate import this file, when I select it within xcode, the text shows up as gibberish.
In Xcode 3 when you drag the Localizable.strings into your project, the dialog box which appears gives you the option to change the text encoding, but this is not the case in Xcode 4.
Does anyone know a way around this?
Maybe this can help you Objective C/Xcode 4: Encoding Problem with Localizable.strings files
These kind of errors can happen if you copy and paste content within Xcode or from external files in your localization files. The consequence is that the encoding of the file changes to for example Western (Mac OS Roman). The Localizable.strings file should be in UTF-16 though.
Solution
1.
Like in the picture below, navigate in Xcode to the Localizable.strings location and open it so that you can see all the languages you are supporting.
Left-click on the language file the causes the build error.
Make sure your Utilities View is showing in Xcode. Activate on the button at mark 1 in Picture below.
In the Utilities View select the File Inspector. (Small Logo that looks like Page)
Under Text Settings change the encoding to UTF-16(Marked as 2 in the picture above). The Drop-Down might be grayed out but you can click on it anyways. Click on "Convert" on the Popup.
That's it your project should now compile again.
The "Text Settings" for my Localizable.strings files don't have the option of changing the encoding like XCode 3. However, I found if I simply restart Xcode 4, it reinterprets it correctly (UTF-16).
Sometimes Xcode displays the warning, even if the file contents are UTF-16, but the file is somehow interpreted as UTF-8. iconv usually says that it can’t convert the file in this case. Converting the file in Xcode to UTF-8 and then converting it back again to UTF-16, like Edmar suggested, solves this problem. The warnings are gone.
To make sure that nothing got broken during the conversion, recheck the whole strings file.
After changing the encoding, and re-executing the genstrings command to regenerate the localize string, things should work.
View -> Utilities -> Show File Inspector
Change Text Encoding in the file inspector utility view.