language support in android
I want to create an android application which requires Kannada language,the regional languauge of Karnataka,India.Could anyone let开发者_开发知识库 me know whether I could create my application based on that? Thanks
Just try this
Step 1: Download a kannada font .ttf file. (For example say brhknd.ttf).
Step 2: Now create a directory "fonts" in your assets folder in the android project.
Step 3: Now copy the brhknd.ttf file into assets/fonts folder in you Android project.
Step 4: Add these lines to your onCreate()
Typeface kannada = Typeface.createFromAsset(getAssets(), "fonts/brhknd.ttf");
Step 5: Now provide this typeface to your TextView you want.
textview= (TextView) findViewById(R.id.tipstext);
textview.setTypeface(kannada);
textview.setTextSize(20);
textview.setText( "Jackson dsilva mangalore");
精彩评论