I know that we can send plain text to whatsapp through an intent like :
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT,"Text to be sent on whatsapp");
sendIntent.setType("text/plain");
sendIntent.setPackage("com.whatsapp");
startActivity(sendIntent);
But I want to be able to send emojis (emoticons) to whatsapp through an intent.
How is it possible?
Do we have some special codes for the emojis?
To use emoji, simply tap the icon to open the emoji selection menu. To switch back to your keyboard, tap the icon. Some emoji are available in different skin colors. If you want to select a different colored emoji, tap and hold the emoji you wish to use and select the color you want.
To use any emoji for reaction, long-press on a message, tap on the + button and pick an emoji through the full list. You'll see the emoji you picked under the message. The new feature is just a fun visual addition that doesn't limit you from using six preset emoji.
You need to be on the latest version of WhatsApp to get support for message reactions. To react to a message on iOS, iPadOS, and Android, press and hold the message and select the emoji of your choice to react.
Tap and hold a message. Choose an emoji reaction.
I used StringBuilder for this like:
int unicode = 0x1F600
StringBuilder s = new StringBuilder();
s.append("YOUR MESSAGE HERE");
s.append(Character.toChars(unicode));
The resulting string will be something like this
YOUR MESSAGE HERE😀
Copy the unicode from here But remember to change the code that you will copy from this webpage from U-1F600 to 0x1F600.
U-1F600 is the unicode but android doesn't recognizes this. 0x1F600 is the hexcode for android.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With