droideckar
droideckar

Reputation: 1067

how to replace emoji in android softkeyboard

To display the emoji button in the soft keyboard I use this in the EditText:

android:inputType="textShortMessage"

which uses the emoji icons for my device (which may be specific to my carrier/phone model).

I want to use my own set of drawables instead. Is there a way to do this without having to create a completely new soft keyboard?

Upvotes: 1

Views: 1168

Answers (2)

droideckar
droideckar

Reputation: 1067

I was able to solve this by using the EmojiHandler from here:

To get the unicode of the emoji from textual message content:

String s = EmojiHandler.decodeJava(content);
// use decoded string to display emoji in TextView, Button, etc                     
textButton.setText(s);

To encode the emoji from the softkeyboard and put it into a String:

String encodedEmoji = EmojiHandler.encodeJava(msgText);

Upvotes: 0

madlymad
madlymad

Reputation: 6530

No, there isn't any single line solution, maybe there is one at Lollipop as it is shipped with emoticons.

Options:

  • Implement a keyboard (needs a lot of effort + user to change his default keyboard)
  • Implement a panel/dialog that act as keyboard (needs less effort)
  • Use an existing library to do so a list of libraries is here but you can search for more if you want!

Upvotes: 1

Related Questions