Android app icon with image + text? - android

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.

Related

Unity Android keyboard text shows white text on white background

I'm creating a Unity application with textfields in it.
In the beginning there were no problems with the textfield inputs. I could write and texts would show nicely on the keyboards line
Then I've added some assets which altered the manifest. I don't know which line but I have multiple (5 exactly) AndroidManifest files in my Unity project and I'm facing this problem
When I'm typing with keyboard, text does get typed but it has white color on white background. I can select the text, edit the text but its bad for user to use a keyboard like that
What should I do? Thanks a lot!
ps. This problem does not occur on iOS devices. Only on Android
We experienced the same problem but we were able to fix it by adding the following property:
android:theme="#style/UnityThemeSelector"
To the application tag in the file
Plugins\Android\AndroidManifest.xml
Eg:
<application android:theme="#style/UnityThemeSelector"...
I'm not sure how that applies to having multiple manifests but perhaps only one of them has the application tag.

Android strings.xml resource - arabic language and dynamic formatted strings

Hello I have a question about arabic formatting how should I properly format this strings, it seems i can't manage this:
تحميل %1$s…
تم تحميل الكلمات. %1$d/%2$d!
This is in sublime text 2 - but i think that there is Left-to-Right order
EDITED:
In Eclipse this copied from Sublime Text gets messed up a little. I hire some person to translate from english to arabic strings.xml. He used Word editor but things get messed up when coping to eclipse and I suggested to changed it in Sublime Text, that I think will support it correctly like in Eclipse and is lighter editor. I see that in Sublime Text seems to be in Left-To-Right order which is also wrong.
* When I run app with this messed up special characters it seems to run correctly. Bu I have doubt whether some interpunction words hasn't also messed up and for example: Item 5/10 has been downloaded. will be Item has been downloaded. 5/10 or something like this.*
Need a preferred way to get someone english written strings.xml, get this translated, and then copied into /values-ar and working correctly?
Try adding a RIGHT-TO-LEFT MARK character (\u200F) at the start of your text.
similar type answered here
That is a sublime issue with Right-to-Left languages as listed here. You dont have to worry too much about it because it does not affect the results, your app will show it perfectly.
"To solve this problem, use the unicodeWrap() method, found in the BidiFormatter class, on every piece of text that you insert into a localized message."
Quoted from here https://developer.android.com/training/basics/supporting-devices/languages.html#FormatText
You have to use Arabic Font like:
Typeface face = Typeface.createFromAsset(this.getAssets(), "fonts/arabic_letters.TTF");
yourTextView = (TextView) findViewById(R.id.yourTextVIew);
yourTextView.setTypeface(face, Typeface.BOLD);

Arabic Text Issue In Android

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.

Need edit command in android edit text in danish language

Am doing a danish project, so when i long press in the edit text box i need the "Edit", "copy", "paste" etc commands in danish. In my phone there is no danish language can be selected.
any help is appreciated.
thanks in advance....
jibysthomas
I think you have to use Typeface for using Danish language without selecting Danish language from your phone language.
And for long press dialog I think you have to make your custom dialog and use that. I am not sure but this is my idea.
Thanks.
I use "Scandinavian keyboard " and when i need it press and hold the input box and change the "input method" to this keyboard
https://play.google.com/store/apps/details?id=com.android.inputmethod.norwegian&hl=es
hope it works 4 you
Your Android build must support each localization for the system menus to appear in the desired language. Yes it is possible to support a language by overriding the system menus but if you use Danish as your default language in the app and the system language is set to Danish the system menus will appear in Danish.
Download a custom locale app from the market and use it to change your phone locale to Danish. In your app, you then need to support localization. Read this document on localization. It helped me a lot when I was localizing an app. Briefly, you will need to create a "values-da" folder under res, create strings.xml and define the strings you need with your Danish values. Don't forget that you need to have a strings.xml file in your regular "values" folder as well with all the strings defined. This folder represents the default string values, and is useful to fall back on if a string is not found in your "values-da" folder.
Trust me, the whole process is actually a lot easier than it sounds.

Text align problem when using Arabic font

The screenshot below displays my problem.
The first EditText shows a hint in Arabic which is shifted upwards, now the second EditText is just for reference which shows the English version completely fine. Same goes for the Button.
I have declared the string in strings.xml like this:
<string name="ar_login">دخول</string>
This is how I set the EditText's hint:
UserName.setTypeface(ArabicFont);
String hint = getString(R.string.ar_HintUserName);
....
UserName.setHint(hint);
UPDATE:
I used this, but of no use:
UserName.setGravity(Gravity.CENTER_VERTICAL);
But with this, Text moved a little down; but i guess its not generic:
UserName.setPadding(0,15,0,0);
With Padding, English words move to downwards.
UPDATE 2:
Originally arabic texts are separated; means they are shown letter by letter. So to join them, i was using this Arabic Reshaper. To Download Code, Check this link
Now when i reshape the arabic text and then set on TextView or as EditText's Hint, it got shifted upwords but without reshaping it is fine.
So i guess, whether i have to change the reshape class OR make my textview to not split the word. But dont know where to go?
I am still unable to find out why Android splits the arabic words into separate letters anyhow in my second edit I am providing a link which uses a class to rejoin the separated letters and form a word again.
In the reshape function, it was mistakenly appending \n at the end, just removing it solves the problem.
I am sure its problem with the font file which you are using.!
[Sorry I am not allowed to upload the screen shot as my reputations are lower :(]
For the layout, I was setting text in xml, and typeface in code. And I'm not setting any attributes like padding/gravity. But it was working fine for me.
So, I can assure you that using font file whose style matches your requirement will solve your problem.
Just to help you out with, but 'm not sure I got font file from DroidSansFallback.ttf
Just a guess :) ...,
What if the size of the Arabic font is lower? [If this is the case, then Gravity.CENTER_VERTICAL should have worked for you :( ]
May be this is the style of that font file. How about trying a different font file for Arabic text ?

Categories

Resources