Vincent Durmont

« Back

January 11, 2015

emoji-java — The missing emoji library for Java

A few weeks ago, I released a first version of emoji-java on maven central! The lightweight library helps you easily handle emojis in your code.

Emojis

Find the code on Github and spread the world ;)

Some quick examples:

Convert a string with unicode emojis to an html representation

String str = "An 😀awesome 😃string with a few 😉emojis!";
String result = EmojiParser.parseToHtml(myString);
System.out.println(myString);
// Prints:
// "An 😀awesome 😃string with a few 😉emojis!"

Convert a string with aliases to unicode emojis

String str = "An :grinning:awesome :smiley:string 😄with a few :wink:emojis!";
String result = EmojiParser.parseToUnicode(myString);
System.out.println(myString);
// Prints:
// "An 😀awesome 😃string 😄with a few 😉emojis!"

Browse the emojis by tags

List<Emoji> emojis = EmojiManager.getForTag("happy");
// Iterate over the emojis!

The complete documentation is on Github an pull requests are welcome :)