Hi any body know how we can support Hindi and Gujrati Languge support in android. I used below code but it is not supported, I see only box.
I put string file in res/values-hi/string.xml folder. There is some key value for Hindi language. It is used for Hindi Language:
Locale locale = new Locale("hi");
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getBaseContext().getResources()
.updateConfiguration(config,getBaseContext().getResources().getDisplayMetrics());
Anyone knows than please give me solution.
As gujarati and hindi languages are not supported by Android, you can still give that support to your Application.
For Gujarati copy the C:\WINDOWS\Fonts\Shruti.TTF file to your Assets folder click here to know how to make assets folder
then use the following code.
TextView text_view = new TextView(this);
Typeface font = Typeface.createFromAsset(getAssets(), "Shruti.TTF");
text_view.setTypeface(font);
text_view.setText("ગુજરાતી");
Shruti.TTF file is for Gujarati font.
Similarly you can add support for hindi file.
Hindi and many other Indian langy=uages are not supported in Android. Though HTC is planning to provide support for some Indian languages.Read Here.
Now, the code you used to put Hindi text in your app will only work if the Android phone has built in support for Hindi language.
You need to embed Hindi fonts in your app as Kri said.
Hindi reading method in opera mini 1 - First install latest version of "Opera Mini" on Android powered tablet or phone which is available free on Android Market. Otherwise go to official site of opera. (Read about Opera Mini & download) 2 - After that go to address bar & type opera:config and nothing should have www or http://. 3. Then come to the menu & at its end see "use bitmap fonts for complex scripts". No sentence will be written in front of. You change it to Yes. 4. Save it. Now Open any Hindi site and see hindi font on your mobile / tablet instead of square font.
Your can try the following also… Install Hindi font (including all Indian language) as system font - go this link:- http://android-bucket.blogspot.com/2011/07/hindi-font-installation-for-advance.html (Only for Advance users)
Related
I am trying to learn/build my first few apps on android using android studio. Apart from default language, I wanted to add support for HINDI language. I have created strings.xml file required for hindi and I have verified that whatever string I put in this file is displayed correctly when HINDI language is selected on Android device. To try this, I just wrote different sting in English characters, because I am unable to figure out how to write in HINDI in android studio.
For eg. I want something like this in my hindi strings.xml
<string name="customer_name">क्रुपया अपना नाम लिखे</string>
Currently I just have this in my XML:
<string name="customer_name">Please enter your name</string>
Could someone please provide on what should I do to type directly in hindi language in android studio xml?
You could use on-line Hindi editor like http://www.quillpad.in/editor.html and then copy paste your words in the android studio translation window.
Not sure whether this has been answerd already or not, but I did it by typing the words/phrases in Microsoft Word using Hindi keyboard, and then copy-pasted the text into Android Studio Translation Editor.
Not sure whether your problem is Hindi typing or Android Localization.
There are many options.
You can use a mobile keyboard.
You can use transliteration which is a word-level conversion from Roman to Hindi.
or Microsoft Indic tool which is a char level conversion to Devanagari chars.
There is no learning curve in using transliteration. Transliterators are provided by Google and Microsoft both.
Microsoft transliterator and indic tools both are available here.
https://www.microsoft.com/en-in/bhashaindia/downloads.aspx
By the way, the right spelling is कृपया not क्रुपया
I have a rooted phone and was trying to play around with my phone. It has android 2.2 installed. What I want to do is to display Hndi/Tamil/Telugu text inside the application that I was trying to develop. Obviously android 2.2 does not support these fonts.
As the phone is rooted doing this was easy for one language. I just followed the tips given in this link Enable Hindi Fonts on Rooted Device and was able to get Hindi fonts throughout the system. Similar approach helped me setup Tamil fonts.
But I am not able to make both Hindi and Tamil work together. The possible solutions I can think off are :
i) Create a common ttf file which shall contain both Hindi and Tamil fonts. But I have no idea whether this is possible or not.
ii) Keep a .ttf file for each language in the assets/fonts/ folder but again this is showing just square boxes on the device.
I tried this link Display Different Languages In Applicationtoo but again this seems to work for only supported fonts.
Any guidance would be highly appreciated. Thanks
Try this sample application.I shared here the whole application code for how to display one text in multiple languages especially Kannada and Telugu.
I would like to set my emulator locale to some custom locale for Indian regional languages like Tamil or Kanada or telugu. Any one plz give suggestions, Thanks in Advance.
you must download your language font file(.ttf). after,import font file in your project assets folder create folder fonts and paste your font file(.ttf) to folder fonts.
after following instructions in below link for stack overflow post :
Android Tamil font between english word
(or)
Refer this document
http://developer.android.com/training/basics/supporting-devices/languages.html
iso code for all languages link below
http://www.w3.org/WAI/ER/IG/ert/iso639.htm
Welcome...!
It is my fault not clearly understanding android documentation link given below
http://developer.android.com/guide/topics/resources/localization.html
For others sake,
Creating and using a custom locale is for developers to test localization apps in android emulator.There are two ways to create custom locale for more see above link.
* Use the Custom Locale application, which is accessible from the Application tab. (After you create a custom locale, switch to it by pressing and holding the locale name.) In my case I given te_IN for telugu(Indian) locale.
* Change to a custom locale from the adb shell
I am just confused by checking custom locale app in device.
Also, Right now there is no default locale support for Indian regional languages except for Hindi, for which code is hi_IN, that too in Android 4.0.3. So even though we set Custom locale to telugu Indian i.e te_IN, Android system will not identify telugu fonts. Any suggestions on this? I want this on Android 2.2 version.
I want to know that how good is android when supporting non-english characters? Is it possible to embed fonts in my app and make the app to use that font?
The system fonts already support Unicode language very well (as well as Eclipse, but you will have to select new encoding when saving, Eclipse will confirm this).
You can embed your fonts as well. Look at this tutorial and this discusstion.
More information: I'm working on Vietnamese. The system is perfect for Vietnamese, and I think it is for other languages, too.
FYI the emulator with android 2.3.3 support hebrew characters.
But you can use your own fonts if you want.
Place them in the res/assets folder, then
TextView txt = (TextView) findViewById(R.id.custom_font);
Typeface font = Typeface.createFromAsset(getAssets(), "my_font.ttf");
txt.setTypeface(font);
I'm a developer for a japanese company and i've hadno problems with japanese characters even on devices set for english. However, if you want to use custom fonts, use vvieux's code :)
how to show hindi characters in android ,i have simple webview apllication ,it loads the url of some site which contains hindi characters ,but its showing [][][][ at place of those characters ,even the default android browser shows the same (not showing the hindi characters) the android version is 2.1, text encoding is set on unicode(UTF-8) in default android browser .,is there is any way to get the support for hindi characters
i hope my question is clear ,
Its the font-support
The Characters other than the most Basic ones, are not there in the TTF Font Files - Namely, DroidSans and DroidSansFallback
Any system needs to have the font on it to display the same.
In case of web pages, you can provide the font to the client to download and use
But in case of Android, its supposed to load characters only from DroidSans.ttf and DroidSansFallback.ttf
So if you want to view something in Hindi, these font files ( in system/fonts ) must support your characters
Your Options...
DroidSans.ttf is limited so you can't edit that. Download any font that has Hindi Character support and name it to DroidSans.ttf and replace in system/fonts.
- This will mess your default font
Download a TTF font that has Hindi Characters and Name it to DroidSansFallback.ttf and replace in system/fonts.
- This won't mess up anything & is a Better Option
Create a font using Font Designing Softwares and ADD as many characters as you wish (including HINDI) and follow the latter part of statement 2.
- The BEST Option !!
Use a Browser that has its own support for Hindi Fonts.
- Simplest option for people without ROOT *
* - Root implies Rooting of Android Device - Rooting Android
With Opera Mini browser, now you can read Indian language content on mobile phones which don't have built in unicode fonts. For this we need to turn
on the bitmap fonts in 'opera mini'
Type 'about: config' in mini address bar. This opens configuration settings.
There is a option for use bitmap fonts. Change that to Yes.
There is no way (not yet) to show any of the Indian characters of Indian languages on Android. It simply is not supported. See the following links for further information:
Link 1
Link2
It existed as a feature request, at least until 2.2. I am not sure if language support has been added for Hindi and other Indian languages from Android 2.3 and 3.0 onwards.
On a side note, does the same website work properly when you open it with a normal web browser?
Hindi is not supported in most devices.
But you still can browse Hindi websites using the app, SETT Hindi Browser if your Android version is above 2.2. It's an exclusive browser for Hindi & it displays Hindi in any device.
Here is the link: https://market.android.com/details?id=lk.bhasha.sett.hindi
Here is how it displays Hindi:
Me also struggled with this for one day but finally found a solution.
Just add these two lines of code it will work
WebSettings webSettings = webView.getSettings();
webSettings.setDefaultTextEncodingName("utf-8");