0

Here is my sample code :

final String[] items = {"এক", "দুই", "তিন"};
builder = new AlertDialog.Builder(TestActivity.this);
builder.setItems(items,TestActivity.this);
Imran Rana
  • 11,899
  • 7
  • 45
  • 51
  • language support for android has been discussed before, check [this](http://stackoverflow.com/questions/3626976/do-android-support-multiple-languages) – AurA Apr 29 '12 at 13:13

2 Answers2

3

Create your own dialog with custom view, say with TextView that has the custom font in it. In your case put a free Bangla ttf font (say bangla.ttf) in font folder under assets folder then use setTypeface to attach this font to TextView like:

  textView.setTypeface(Typeface.createFromAsset(getAssets(), "fonts/bangla.ttf"));

You can listen to touch event on those TextViews for desired action. Here it is, how it looks on emulator: enter image description here

But complex glyphs are always shown as broken characters(even if you install font on device), you can check my answer here: installing bangla font

To show complex glyphs image replacing is the only solution which can be done with few images and very fast processing if you use overlay technique which i used for my softkeyboard.

Community
  • 1
  • 1
Imran Rana
  • 11,899
  • 7
  • 45
  • 51
0

The way you have written is actually correct. But the problem is Android doesn't officially support Bangla yet. But in some custom ROM, bangla is integrated. So, Bangla will be shown only on those devices, which have custom ROM installed (with Bangla support).

So I would suggest you to use image of the letters instead of using actual bangla font.

jamael
  • 398
  • 1
  • 4
  • 13
  • Thanks for your reply. But the items will be frequently updated. So, in this case I have to use lots of image, which needs a lots of memory. Please suggest me a different way. – Shahed Iqbal Apr 29 '12 at 14:23
  • could you please give some sort of idea, what you are gonna do? – jamael Apr 29 '12 at 14:36
  • I am trying to make a spell checker. For the incorrect words if i touched that particular word it will show a dialog with list of suggested word with its bangla meaning. – Shahed Iqbal Apr 29 '12 at 14:59
  • Well... tough job! I am afraid that is not possible for now. You have to wait until android integrates bangla officially. btw, you are only talking about `AlertDialog`. are you able to show bangla in other places like in `TextView`? Anyway, if your app will be used by fixed number of user (if you know all the users!) then you can install bangla font in their devices. you can follow this [link](http://code.google.com/p/bangla-on-android/wiki/BanglaFontInstallation) for installing bangla font – jamael Apr 29 '12 at 15:19
  • Thanks again. I will try for the second option. – Shahed Iqbal Apr 29 '12 at 16:03