Neeraj Kumar
Neeraj Kumar

Reputation: 3941

Hindi Text in Eclipse on Android

How can one directly input Hindi text into the eclipse IDE on android?

I would like to type Hindi text directly into the eclipse IDE without copy/pasting it from somewhere else, see this demo for an example of writing Hindi text quickly.

I would like to do the same thing in the eclipse IDE.

Upvotes: 0

Views: 1950

Answers (5)

Neeraj Kumar
Neeraj Kumar

Reputation: 3941

Today i found solution of my question.

i found that Google develop many inputtools for windows OS , Android and for Web in many language that use for fastly type any language with the help of English typing.

So i download inputtools at URL : Download Page thank you Everyone for help me

Upvotes: 0

Ansal Ali
Ansal Ali

Reputation: 1603

I think you are looking forward for multi-language(English AND Hindi) support for your application. If so, enter image description here

strings.xml in values folder

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="welcome">accueil</string>
    <string name="email">adresse e-mail</string>
    <string name="password">mot de passe</string>
    <string name="login">connexion</string>
    <string name="signup">Ne pas avoir un compte? signer</string>

</resources>

strings.xml in values-hi folder

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="welcome">स्वागतम</string>
    <string name="email">ईमेल पता</string>
    <string name="password">पासवर्ड</string>
    <string name="login">लॉगिन</string>
    <string name="signup">खाता नहीं है? साइन अप करें</string>

</resources>

for more references please check this link

EDIT (as per the comment)

Try this

1.Windows > Preferences > General > Content Types, set UTF-8 as the default encoding for all content types. 2.Windows > Preferences > General > Workspace, set "Text file encoding" to "Other : UTF-8".

For more references, please check this blog

Upvotes: 1

KOTIOS
KOTIOS

Reputation: 11194

Use UTF-8 encoding in android studio , below is setting page , using utf-8 encoding will allow you to paste hindi fonts in xml and java code.

enter image description here

For Eclipse IDE : below is path to configure the encoding :

Preferences > General > Workspace > Text file encoding

Upvotes: 0

Amsheer
Amsheer

Reputation: 7131

Yes Hindi language can support in Android devices. You need to follow the steps.

Step 1:

Just create one values folder under resources like values-hi and add strings.xml file inside of this folder. You can add your translated strings in this strings.xml file.

example

<string name="your_text">अपका संदेशर</string>

Step 2:

If you call your strings from the other layout xml files then just call like the following

android:ext="@string/your_string"

Step 3:

You can also use string values in java code programmatically.

Upvotes: 1

N Kaushik
N Kaushik

Reputation: 2208

Use hindi texts inside String.xml file like

<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="hindiText"> पवन कुमार</string>

</resources>

And use this on your app's TextView

<TextView
    android:id="@+id/textView"
    android:gravity="center_horizontal"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/hindiText"
    android:textSize="28sp" />

Upvotes: 2

Related Questions