I am working on an application that will work on Android WebView. I enabled the selection and copy for this view. In some devices that support Arabic, When I paste the copied text from WebView in any EditText view, It shows me the reserve text. but In some cases it shows me the correct form.
Could any one please help me to show in correct form in all devices ? :-/
I have red all threads that depend on supporting Arabic and Farsi Text, but I can not reach my purpose.
Thanks in advance :)
You can pass your copied text to FarsiLibrary. It will analyses your text letters and justify them according to their possible 4 states (Initial, Middle, End, Isolated) :
Initial like 'ن' in 'نازک'
Middle like 'ن' in 'هنر'
End like 'ن' in 'وطن'
Isolated like 'ن' in 'ایران'
Android has Added support for RTL in Native widgets(i.e TextView , EditText) . so if u run the app onward 4.2 u will get RTL feature automatically ,
http://android-developers.blogspot.com.es/2013/03/native-rtl-support-in-android-42.html
You can create different versions of the layouts for different API versions.
As you can read here: http://developer.android.com/guide/topics/resources/providing-resources.html you can have say the normal folder (/res/layout/) with the layout for old devices and then another one for the ones that support it: /res/layout-11/
The layout inside layout-v11 will only be applied on devices with android 3.0 and over.
Related
my problem is that I can't put '\u221c' unicode on button in Android app. '\u221a' is OK and works, but 221b and 221c doesn't. Also, when I want that button to put text '\u221c' in EditText it puts \u221a. I dont know why it works that way and how to fix this. Please help
This appears to be simply a font problem. U+221A SQUARE ROOT “√” is a much more common character in fonts than U+221B CUBE ROOT “∛” and U+221C FOURTH ROOT “∜”. You may need to find a font that contains them and bundle it into the application, or use other notations.
You can, in particular, use fractional powers instead of roots. That’s even the preferred way, according to the standard ISO 80000-2. So instead of ∜a, you would use “a” followed by “1/4” in superscript style, if that’s possible in the application.
I have used localization in my android application. Which supports two kind of layout in application.
I have used Fragment and Fragment Activity in my application.
If language is English then layout should be aligned to left as shown in image below.
And if language is Hebrew then layout should be aligned to right as shown in image below.
I am trying to load this layout by two different layout files and then I can detect which language and I can use appropriately.
Is there any other good methodology through I can use achieve this functionality without creating different XMLs for all layouts?
Can anybody please help me to resolve this issue?
This should help:
http://developer.android.com/about/versions/android-4.2.html#RTL
Android supports right-to-left layouts natively since android 4.2.
Creating two similar layouts those are having same #+id values is a clean approach but if you don't want to create two different layouts then you could simply set the layout_gravity attribute by code with some helper method and by getting the LayoutParams of the containers you are using in your xmls.
Edit :
From another answer , If it works for you with the support package i.e. v4 if you are targeting 2.2+ above then this would be an awesome approach to go with.
http://developer.android.com/about/versions/android-4.2.html#RTL
just came to know about this. Android is awesome!!
Let me specify the problem first.
My app is designed for text mainly in Hindi, and I want to target Android OS below 4.1, which doesn't support hindi characters(yes, I've tried various Hindi fonts, which don't work properly, or the desired outcome is not the expected one).
So, I've prepared icons with hindi text, and all works perfectly fine now.
The problem left with is, how can I specify hindi text for the launcher icon?
I've tried to specify hindi text by creating an image with hindi text, and left the application:label ="" and activity:label="" blank.
But the text doesn't appear in where the app name should have appeared, or apparently I didn't create the image correctly.
Any help in this regard would be appreciated :)
I hope you already have tried Krutidev (Hindi Font), if not you can try it.
Though it may late to answer now, but as i read this now, i would like to answer since I did the same in my application in the following way:
1. Just in application tag of your app's manifest, give app name as normal:
android:label="#string/app_name"
2. in resource file strings.xml, add a string 'app_name' with the name your want for your app. Be careful, what i did was: i typed the text using Google transliteration and i gave this in Hindi.
3. Then when you save your strings.xml, it will ask you to save this in proper encoding, then choose 'utf-8', and that's it.
What is the best way to provide the ability to switch between hebrew/english layouts in Android applications?
Is it commonly done - or usually just providing hebrew or english applications.
I know there is abikty to use localiztions - but is there Hebrew support for this?
Also my application should be for iPhone as well and I want to keep it the same.
How should do it in the code? Where to place the layouts?
Yoav
For orientation (right-to-left) you need: android.text.Layout.Direction
A hebrew TrueTypefont can then be called from a resource in your app by including TextView.
Instead of pushing 2 layout files you could use a class for hebrew and another for english...
or you could push the text to string values file for highest cleanliness
If it is a block of text that could be called from resource txt file (practical for prayers)
It all depends on how much text you have.
My application displays Hebrew text which comes from a Web Service.
When a sentence contains digits (in the middle of it), the digits appear in a mirror view:
29 appears as 92, 21:45 appears as 54:12 and 2,000 appears as 000,2.
Also, when a sentence starts with digits or English characters, they get thrown to the end of the sentence messing it all up...
Does anyone have an idea how can this be solved? Is RTL support in Android still immature?
Try presenting your text in a webkit control, its RTL support works fine, as long as the HTML code is tagged appropriately.
Is RTL support in Android still
immature?
If by "immature" you mean "nonexistent", then, yes, it is immature. Each Android SDK release lists the supported languages, and you will notice that RTL languages are not among them.
Forward to 2015 - those issues are gone, and the answer marked as correct is no longer correct.
This is fixed in CyanogenMod. I'd very much like to know which commit has the fix exactly