Open In App

How to Integrate Emojis in an Android App?

Last Updated : 08 Sep, 2020
Like Article

Emojis certainly make the app more interesting and fun to interact with. In this article, let’s learn how to add Emojis in our own Android App by creating a simple application that looks like a messaging app.

Why do we need Emojis?

  • It makes the app look more user-friendly and fun.
  • If the app features used for building communication, emojis certainly help to express a user’s feelings.
  • It may be used to ask feedback of an app from the user.


Step 1: Create a new Android Studio project

To create a new project in Android Studio please refer to How to Create/Start a New Project in Android Studio. Note that select Java as the programming language.

Step 2: Add the following dependency to build.gradle(:app)

In order to use emojis in the app, add its dependency to build.gradle(:app) file. Add any one of the three dependencies: 

implementation ‘com.vanniktech:emoji-google:0.6.0’

implementation ‘com.vanniktech:emoji-ios:0.6.0’

implementation ‘com.vanniktech:emoji-twitter:0.6.0’

Each dependency signifies the emoji set we are importing. That is, either from ios, or Google, or Twitter

Step 3: Working with activity_main.xml file 

In this example, make the app look like a chat app. For this, use two Buttons. One to add emojis and one to send the message. Add also an EditText where the user will type the message. This is how the activity_main.xml looks like:


<?xml version="1.0" encoding="utf-8"?>
        android:hint="Say something to GeeksForGeeks..."

Step 4: Create a layout file called text_view_emoji.xml

Create a layout to define how the emoji should look like. Its main purpose is to define the size of the emoji. It will also display the messages which we send. Create a new layout by clicking: app ->res -> layout(right-click) -> New -> Layout Resource File.


Name this as text_view_emoji. This is how the text_view_emoji.xml looks like:


<?xml version="1.0" encoding="utf-8"?>

Step 5: Create a class called EmojiApplication

Depending on which emoji set the user wants to have, set up the corresponding providing here. By setting up the EmojiManager here, make sure that the user can use them anywhere in the app. To create a new class, click on: File -> New -> Java Class.


Name this as EmojiApplication. This is how the looks like:

import com.vanniktech.emoji.EmojiManager;
public class EmojiApplication extends Application {
    public void onCreate() {
        EmojiManager.install(new GoogleEmojiProvider());

Note: Do not forget to add this new class in the AndroidManifest.xml file. This is how the AndroidManifest.xml looks like after adding:


        <activity android:name=".MainActivity">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />

Step 6: Working with the file

Here, write a function to inflate the EmojiTextView. The LayoutInfalter is used to convert a View or a ViewGroup written in XML to a View in Java which can use in the code. Also, set the onCreate() function here. After all these changes, this is how the looks like:

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import com.vanniktech.emoji.EmojiPopup;
import com.vanniktech.emoji.EmojiTextView;
public class MainActivity extends AppCompatActivity {
    EditText etEmoji;
    LinearLayout llTextViews;
    protected void onCreate(Bundle savedInstanceState) {
        final EmojiPopup popup = EmojiPopup.Builder
        Button btnEmojis=findViewById(;
        btnEmojis.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
        Button btnSend=findViewById(;
        btnSend.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
    private EmojiTextView getEmojiTextView() {
        EmojiTextView tvEmoji = (EmojiTextView) LayoutInflater
                .inflate(R.layout.text_view_emoji, llTextViews,false);
        return tvEmoji;

Output: Run on Emulator

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads