Emoji Keyboard support for EditField in android

My app uses Android 4.0 on the Samsung Galaxy S3.

I want to integrate Emoji character support into the EditText field in an Android application. Can anyone suggest me how I can achieve this?

For example, in a Whatsapp and wechat application, TextField supports Emoji keyboard characters, but in my application does it display ? for every character I use using the Emoji keyboard.

Screenshot explaining my need

 text_message = (EditText) findViewById(R.id.editText1); text_view = (textView) findViewById(R.id.textView1); btntest = (Button) findViewById(R.id.button1); btntest.setOnClickListener(new OnClickListener() { public void onClick(View v) { text_swype.setText(text_message.getText().toString()); } }); 

and I will also try https://github.com/IPL/iOSStyleEditText

and emoji font from http://klncity1.wordpress.com/tag/emoji/

but does not work

+7
android android-softkeyboard unicode emoji
source share
5 answers

This depends on the font used for the TextView or its subclasses, such as EditText .

Each View can display emoji because hundreds of emoji are included in Unicode, and they have also become standard on most keyboards and emoji apps like WhatsApp.

However, you will not see these colorful images, as you see in WhatsApp, for example. This is because WhatsApp uses custom fonts / images for these emoji, which replace the default look.

But if you add emoji to the text box in your regular Messages application or somewhere else, you will see a regular Android style, which is a monochrome emoji showing an Android robot.

Here is a list of common emoji and their Unicode codes:

https://github.com/delight-im/Emoji

All are supported by the regular Android font. You may have changed the font of your EditText in the layout.

+3
source share

You can use EmojiconTextView or EmojiconEditText from this library: https://github.com/rockerhieu/emojicon

+2
source share

Here is a list of available Unicode for emoji

When sending content to the server, you need to use org.apache.commons.lang3.escapeJava(...) , and when receiving data from the server you need to turn Unicode to an emoticon to use org.apache.commons.lang3.unescapeJava(...)

+2
source share

You should use the "EmojiconEditText" from the library. He will display the Eemojies.

Use any of them.

 EmojiconTextView: a TextView which can render emojis. EmojiconEditText: a EditText which can render emojis. EmojiconGridFragment: a fragment contains emojis in a GridView for the user to choose. EmojiconsFragment: a fragment contains many set of emojis for the user to choose. 
0
source share

Below is Util from org.apache.commons.lang3

Answered to @AZ_ correctly, but the utility name has been updated as follows:

Send the line to the server as:

 org.apache.commons.lang3.StringEscapeUtils.escapeJava(mEdText1.getText().toString() 

Reading a line from the server as:

 org.apache.commons.lang3.StringEscapeUtils.unescapeJava(mData.get(position).getText()) 
0
source share

All Articles