Hi Dhamodharan,
Let me explain this
You can get the data from edit text by using
editText.getText().toString();
But if the edit text has emojis then it will give you the data like below
Hey 💃🏻
And you cannot save the above text directly in the database. So you have to get the emojis as Unicode. To get the emoji Unicode you have to escape the emoji text. Add the following apache library in your project
implementation 'org.apache.commons:commons-text:1.6'
Then import the following in your activity or Fragment
import org.apache.commons.text.StringEscapeUtils
Usage:
String text = editText.getText().toString();
String escapeText = StringEscapeUtils.escapeJava(text);
// this will give you the emojis as the unicode
// Hey \uD83D\uDC83\uD83C\uDFFB
Now you can save the `escapeText` anywhere you want. And to convert back the escaped text to emoji, you can use
String unescapedText = StringEscapeUtils.unescapeJava(escapeText);
// this will convert the unicode to emojis
// Hey 💃🏻
Let me know if you need further any help.
Thanks.