Android Chat Application Emoji's Issue
Solution 1:
There is no specific api available to implement and send emojis. You can achieve this using ImageSpan objects. The TextViews and EditTexts use Spanned/Spannable objects to store the entered text content, not just mere Java Strings. On these Spanned/Spannable objects you can define spans for sections on the text that modifies the way that those sections are shown. So you can display images in place of certain sections.
Check the docs:
Also, I found a blog, it might be helpful for you.
Solution 2:
This Library is all you need to implement Emojicons
. Just don't forget to change your TextView
s and EditText
s to this Library's EmojiconTextView
s and EmojiconEditText
s respectively.
Hope this helps.
Solution 3:
You need to encode emoji before upload. in this way you encode emoji to UTF code
try {
String mystring = URLEncoder.encode(strComments, HTTP.UTF_8);
param.add(new BasicNameValuePair("comment", mystring));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
for decoding
enter code here
try {
StringTitle= URLDecoder.decode(comment, "UTF-8");
holder.tvComment.setText(Title);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
Post a Comment for "Android Chat Application Emoji's Issue"