I tried using this solution but still didn't get the result I wanted. Please help
Android emoji issue(convert "\uD83D\uDE04" to 0x1F604)
I added listener to the edittext and through keyboard typed an Emoji and then using a function got its "escape java code". Ref.
public void afterTextChanged(Editable editable) {
String text = editable.toString();
try {
Log.e("NEWW", "Val "+encodeMessage(text));
} catch (Exception e) {
e.printStackTrace();
}
}
private String encodeMessage(String message) {
message = message.replaceAll("&", ":and:";
message = message.replaceAll("\\+", "lus:";
return StringEscapeUtils.escapeJava(message);
}
Now I want to get this emoji's Unicode which is in format 0x1FXXX.