Sunday 16 June 2013

Telugu Localization in Android ( Display Telugu Font )

Demo: 
Devices =>
2.3 And 4.2

1)MainActivity.java:

package com.venky.displaytelugufont;

import android.app.Activity;
import android.graphics.Typeface;
import android.os.Bundle;
import android.widget.TextView;

public class MainActivity extends Activity {

      @Override
      protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);

            TextView tvTelugu = (TextView) findViewById(R.id.tvTelugu);
            TextView tvEnglish = (TextView) findViewById(R.id.tvEnglish);

            tvEnglish.setText("In English\n" + "Welcome");
            Typeface faceGautami = Typeface.createFromAsset(getAssets(),
                        "gautami.ttf");

            tvTelugu.setTypeface(faceGautami);

            tvTelugu.setText("In Telugu\n" + "సుస్వాగతము");
      }
}

2)activity_main.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#5F04B4"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >

    <TextView
        android:id="@+id/tvEnglish"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="51dp"
        android:text="text1"
        android:textColor="#ffffff"
        android:textSize="20dp" />

    <TextView
        android:id="@+id/tvTelugu"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/tvEnglish"
        android:layout_below="@+id/tvEnglish"
        android:layout_marginTop="66dp"
        android:text="text2"
        android:textColor="#ffffff"
        android:textSize="20dp"
        android:textStyle="bold" />

</RelativeLayout>

3)TTF File:

Download gautami.ttf file and put into asset folder.
To Download gautami.ttf file Click Here 

4)Download this code Click Here

11 comments:

  1. how to install telugu in my lava 504q .can u explain step by step plz

    ReplyDelete
  2. the above font is working but vattu sariga ravatla how to do it

    ReplyDelete
  3. susswagatham laga clear ga ravalante emi cheyal, alginmarigtop, centerHorizontal will that play any role in getting telugu correctly. pls tell me

    ReplyDelete
  4. helo sir, pls help me to get telugu font properly in my android application, in the above image i am getting the first image like content, but i want the content like second image. Vattulu sariga ravatla. pls help me

    ReplyDelete
  5. how pls tell me how to get the font telugu font properly

    ReplyDelete
  6. Sir, recently I baught an android named 'Alcatel One Touch Flash'. It is a KitKat mobile. however, it is not supporting telugu in google, facebook, whatsapp, telegram etc. I installed U.C./Opera Mini browsers in my android and reading telugu. And I installed multiling keyboard/telugu mata key board and writing in u.c. browser. But I can't read write telugu in WhatsApp/Telegram. I am a Telugu Teacher and running two blogs in Telugu. So, this phone is not supporting telugu. What can I do? Please give me any advice to see telugu in my android. Thank you.

    ReplyDelete
  7. Me mobile lo telugu fonts install cheyyandi.Meru run chesthunna blogs anti? share chesthe maaku use avuthundhi.
    Thank you

    ReplyDelete
  8. మిత్రమా,

    నమస్కారం.

    నేను ఈ మధ్య Alcatel One Touch Flash అనే kitkat 4.4.2 చైనా మొబైల్ ఫోన్‍ను flipkart లో (KitKat లో తెలుగుకు ఇబ్బంది రాదని ఎక్కడో చదివాను కాబట్టి) కొన్నాను. కాని, ఇది తెలుగు బ్లాగులకు ఉపయోగకరంగా లేదు. బ్లాగుకై క్లిక్ చేయగానే బ్లాంక్‍గా వస్తున్నది. అలాగే WhatsApp, Telegram లలో తెలుగు బ్లాంక్‍గా కనబడుతున్నది. అంటే Indian Regional Languages ని సపోర్ట్ చేయడం లేదు. నాకు ఏంచేయాలో పాలుపోవడం లేదు. ఇందులో తెలుగు రావడానికి వివిధ విధానాలు serchingలో దొరుకుతున్నాయి. కాని నాకు ఆ పారిభాషిక పదాలు అర్థం కావడం లేదు. నేను ఇక్కడ అవి ఇస్తున్నాను. దయతో ఓపెన్ చేసి అర్థం చేసుకొని నాకు ఎలా దిగుమతి చేసుకొని ఎలా తెలుగును పొందాలో తెలుపగలరు.

    అవి:
    > How to make device to support telugu...(stackoverflow.com/...)
    > Telugu for AnySoftKeyBoard fo Android....(www.9apps.com/...)
    > [How to] Install/Read/Write Regional Languages ...(forum.broidarena.in/...)
    > Download Microsoft Office Language Telugu...(https://www.microsoft.com/te-in/download...)

    వీటిద్వారా ఎలా తెలుగును చదవడం, రాయడం నేను చేయగలనో వివరముగా.. నా మెయిలుకు...gundumadhusudhan555@gmail.com కు దయతో పంపగలరు. నాకు మీరు ఈ మేలు చేస్తే నేను జీవితాంతం కృతజ్ఞుడనై యుండగలను.

    భవదీయుడు
    గుండు మధుసూదన్

    ReplyDelete
  9. మిత్రమా,

    నేను నడుపుతున్న బ్లాగులు: 1. మధుర కవనం (madhurakavanam.blogspot.in), 2. నా తెలంగాణ కోటి రత్నాల వీణ (ratnaalaveena.blogspot.in)

    భవదీయుడు,
    గుండు మధుసూదన్

    ReplyDelete
  10. sir, i am also using alcatel one touch flash. same problems like whatsup, facebook telugu fonts not showing. plz answer and send to my email ashok_dkumar@yahoo.co.in

    ReplyDelete
  11. sir, I need action bar text also in telugu language. any one can help me... plz...

    ReplyDelete