Emoji Keyboard support for EditField in android

后端 未结 5 1571
故里飘歌
故里飘歌 2021-02-09 17:21

My application uses Android 4.0 on Samsung Galaxy S3.

I want to integrate Emoji character support in EditText field in Android application. Can anyone suggest me, how c

相关标签:
5条回答
  • Here is the list of available emoji Unicode

    Sending content to Server you need to use org.apache.commons.lang3.escapeJava(...) and when getting data from server you need to reverse Unicode to emoticon so you have to use org.apache.commons.lang3.unescapeJava(...)

    0 讨论(0)
  • 2021-02-09 17:59

    Below is Util from org.apache.commons.lang3

    Answer posted by @AZ_ is right but the util name has updated as below :

    Send string to server as :

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

    Read String from server as :

    org.apache.commons.lang3.StringEscapeUtils.unescapeJava(mData.get(position).getText())
    
    0 讨论(0)
  • 2021-02-09 18:01

    You have to use "EmojiconEditText" From the Library. It will display Eemojies.

    Use any one of these.

    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 讨论(0)
  • 2021-02-09 18:10

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

    0 讨论(0)
  • 2021-02-09 18:18

    It depends on the font that is used for the TextView or its subclasses like EditText.

    Every View can display emoji because there are hundreds of emoji included in Unicode and those have also become the default that most emoji keyboards and apps like WhatsApp use.

    However, you won't see those colorful images as you see in WhatsApp, for example. This is because WhatsApp uses custom fonts/images for these emoji which replace the default appearance.

    But if you add emoji to a text field in your normal "Messages" application or somewhere else, you should see the normal Android style which is monochrome emoji showing the Android robot.

    Here's a list of common emoji and their Unicode codepoints:

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

    They're all supported in Android's normal font. I guess you may have changed the font of your EditText in the layout.

    0 讨论(0)
提交回复
热议问题