I need to use emoji for chat in my android application.I'm using this library https://github.com/rockerhieu/emojicon to get emoji, its perfectly shows emoji but how can I send/receive to the server for my chat application. Thanks-
This is my code for getting Emoji with the help of library
<com.rockerhieu.emojicon.EmojiconTextView
android:id="@+id/txtEmojicon"
android:text="I \ue32d emojicon"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<com.rockerhieu.emojicon.EmojiconEditText
android:id="@+id/editEmojicon"
android:text="I \ue32d emojicon"
emojicon:emojiconSize="28sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
It shows emoji in EditText and TextView but issue is how can I get this emoji to send/receieve it to the server.I know I need to get Unicode but issue is how can I get Unicode from this Textview or EditText??
Emojis are just unicode. As you can see on that library: android:text="I \ue32d emojicon"
where ue32d
stands for that heart emoji.
More on unicode emojis: http://apps.timwhitlock.info/emoji/tables/unicode
So you can simple send the text to your server and on the other side display it normally and it should be rendered as an image.
来源:https://stackoverflow.com/questions/26117632/how-to-send-and-receive-emoji-to-webservice