I have a problem in Android Programming.I need to post non-English character to server and get non-English character from server in my android code and when I try to do this I face with some characters like " ااننننتبو". anybody can help me?
here is codes for post data :
String data=URLEncoder.encode("username","UTF-8")+"="+URLEncoder.encode(User,"UTF-8");
data+="&"+URLEncoder.encode("matn","UTF-8")+"="+URLEncoder.encode(Matn,"UTF-8");
data+="&"+URLEncoder.encode("status","UTF-8")+"="+URLEncoder.encode(Status,"UTF-8");
If you want your app to support multi-language, you need to have corresponding locale strings available in xml/strings files...
If it is just a few characters like font icons, you can store them in strings resource file.
Check your device whether the language is installed, or try using
Html.fromHtml( "<html><body>"+response+"</body></html>");
I am working on an Android app which supports few other locales apart from English (like PTBr). I get the text from server in PTBr (Brazilian Portuguese) and I display it as it is in a Text view. I have also set my phone's locale to PTBr but still don't see the complete text. A few characters are missing.
I am stressing on "server-data" since I don't have it locally, and thus I can't put it in res-string folders.
Thanks!
I am trying to display text in Indian regional languages on an Android app.
I've set up all the localization folders even though, I just want to have only one language for my app (say Punjabi).
In my strings.xml I have tried putting Hindi characters and Chinese characters and these are displayed correctly on the emulator. But when I put in Punjabi characters nothing shows up on the emulator.
Any reason for this? Can I overcome this problem?
I have the option of using a .ttf file in the assets folder for punjabi font. But that is not what I want to do because it does not give me complete control over the contents being displayed. Each .ttf behaves differently.
Any help is truly appreciated.
There is no support for local Indian languages on Android as yet. Hence the UTF-8 characters that fall outside the acceptable range for Android are ignored. Hence we see a blank being displayed.
I'm trying to retrieve Arabic words that I stored in a text file and display them in my android application, any idea on how to display Arabic letters or words in my app? I've tried different kinds of methods like using the ArabicReshaper and this is an example of the code:
tx=(TextView)this.findViewById(R.id.tt);
try{
tx.setTypeface(Typeface.createFromAsset(getAssets(),"dejavusans.ttf"));
tx.setText(ArabicUtilities.reshape("\u0641\u0631\u0633"));//
}
but I need another way instead of using the Unicode for each Arabic letter and connecting them. Can I not write the Arabic word directly into eclipse?
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");