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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With