How to send and receive Emoji to webservice [closed]

放肆的年华 提交于 2019-12-22 10:02:32

问题


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??


回答1:


Emojis are just unicode. As you can see on that library: android:text="I \ue32d emojicon" where ue32dstands 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!