Home » Tutorials » How to Build a Kotlin Group Video Call App for Android?


In this tutorial, you will learn how to use the MirrorFly SDK coded in Kotlin, for implementing video calling features to Android apps. To get started, we take you through the steps to download our SDKs and then explain the integration process in the Android Studio IDE. At the end, we will show you the steps to connect the client app and the SDK server, to implement the direct messaging functionality.

Here is a quick-list of requirements we’ll use to build the video calling app:

What You’ll Need

The requirements for call SDK for Android are:

  • Android Lollipop 5.0 (API Level 21) or above
  • Java 7 or higher
  • Gradle 4.1.0 or higher

Things to remember:

Get The License Key

Before integrating the MirrorFly Call SDK into your app, make sure to acquire an SDK License Key. This key is essential for the MirrorFly server to authenticate the SDK within your app.

Steps To Get The License Key

Step 1 : Contact our team here to create a MirrorFly user account. One of our experts will get in touch with you to discuss your requirements and help setting up your account.

Step 2 : Login to your account.

Step 3 : Go to the ‘Application Info’ section and get your License Key.

build react native chat app

How To Integrate The Call SDK

Step 1 : Start a new project or open an existing one in Android Studio.

Step 2 : For Gradle versions 6.8 or higher, include the following code in your settings.gradle file. If you're using Gradle 6.7 or an earlier version, add the provided code to your root build.gradle file. Refer to the release notes for more information on Gradle updates.

Gradle 6.8 or higher

                  dependencies { 
                      implementation 'com.mirrorfly.sdk:mirrorflysdk:7.10.0' 

Gradle 6.8 or higher

                  allprojects {  
                      repositories {  
                         maven {  
                               url "https://repo.mirrorfly.com/release"  

Step 3 : Go to the app/build.gradle file, and include the following dependencies.

                   dependencies {  
                      implementation 'com.mirrorfly.sdk:mirrorflysdk:7.10.0'  

Step 4 : Insert the following line into the gradle.properties file to prevent conflicts with imported libraries.


Step 5 : Click here to add the necessary runtime permissions for calls.

How To Initialize The SDK For Calls In Kotlin

Before initializing the SDK, ensure you meet some basic requirements. In your Application class, within the onCreate() method, utilize the following method from ChatManager to provide the required data.

                      ChatManager.initializeSDK("LICENSE_KEY"){ isSuccess, _, data -> 
                         if (isSuccess) { 
                            Log.d("TAG", "initializeSDK success ") 
                         } else { 
                            Log.d("TAG", "initializeSDK failed with error message"+ data["message"]) 

Addition Of MyApplication

Include the created MyApplication in the AndroidManifest.xml file.

 <?xml version="1.0" encoding="utf-8"?>  
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"  
 android:name=".MyApplication"  // Add this line.  
 <activity android:name=".MainActivity">  

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


User Registration

Use the following method to register a user in sandbox Live mode based on the provided setIsTrialLicenceKey.

                         FlyCore.registerUser(USER_IDENTIFIER) { isSuccess, throwable, data ->  
                            if(isSuccess) {  
                               val isNewUser = data["is_new_user"] as Boolean  
                               val userJid = data["userJid"] as String  
                               val responseObject = data.get("data") as JSONObject  
                               val username = responseObject.getString("username");  
                               val password = responseObject.getString("password");  
                            } else {  
                               // Register user failed print throwable to find the exception details.  

Caution: If FORCE_REGISTER is not set to true and there are too many open sessions, you can't register, and it will show an error 405. To sign up, either set FORCE_REGISTER to true, or log out of one of the existing sessions.

How To Connect With The Chat Server

After a successful registration, ChatSDK will automatically try to connect to the Chat Server. Additionally, ChatSDK keeps an eye on changes in the application lifecycle, ensuring it connects and disconnects from the Chat Server as needed.

Steps To Observe The Connection Events

Once the ChatConnectionListener is configured, you can receive updates on the connection status through the specified callback method outlined below.

                         ChatManager.setConnectionListener(object : ChatConnectionListener {  
                               override fun onConnected() {  
                                  // Write your success logic here to navigate Profile Page or  
                                  // To Start your one-one chat with your friends  
                               override fun onDisconnected() {  
                                  // Connection disconnected  
                               override fun onConnectionFailed(e: FlyException) {  
                                  // Connection Not authorized or Unable to establish connection with server  
                               override fun onReconnecting() {  
                                  // Automatic reconnection enabled  

How To Initialize The Chat SDK

In the onCreate() method of your Application class, include the following lines:

                               public void onCreate() {  
                               //Initialize call manager  
                               //set your call activity  
                               CallManager.setMissedCallListener(object : MissedCallListener {  
                                        override fun onMissedCall(isOneToOneCall: Boolean, userJid: String, groupId: String?,    callType: String, userList: ArrayList) {  
                                                 //show missed call notification  
                               CallManager.setCallHelper(object : CallHelper {  
                                     override fun getNotificationContent(callDirection: String): String {  
                                           return CallNotificationHelper.getNotificationMessage()  
                                     override fun sendCallMessage(details: GroupCallDetails, users: List, invitedUsers: List) {  
                                           CallMessenger.sendCallMessage(details, users, invitedUsers)  
                               CallManager.setCallNameHelper(object : CallNameHelper {  
                                     override fun getDisplayName(jid: String): String {  
                                        return ContactManager.getDisplayName(jid)  

Important: The configuration of setCallNameHelper is optional. If not set, the user name will be empty in both incoming and ongoing call notifications. Additionally, note that the sendCallMessage method is utilized to dispatch the initial calling payload to the recipient.

Steps To Set Up Your Call Activity

Define the Call UI Activity in your manifest as shown below:

 tools:targetApi="o_mr1" /> 

Invoke the following method in the onCreate() of your call activity to set up the call activity.


Call the method below in the onStart() of your call activity to inform the call SDK to dismiss the ongoing call notification.


Invoke the method below in the onStop() of your call activity to instruct the call SDK to display the ongoing call notification.


Let’s Prepare The User JID

Most SDK methods require the user's JID as an input parameter. Therefore, the SDK offers the following utility method to prepare the JID. This method constructs the user's JID using the username obtained from the Register response.

How To Make A Call

The call feature is crucial for contemporary communication. The Call SDK enables users to initiate one-to-one audio/video calls with another SDK user.

Note: Ensure you check for the necessary runtime permissions before using Call SDK methods. If the required permissions are not available, isSuccess will be false, and an error message will be provided in the callback.

How To Make A Voice Call

The "Make Voice Call" feature allows users to initiate a one-to-one audio call with another SDK user. Utilize the following method to make a voice call:

                         CallManager.makeVoiceCall("TO_JID", object : CallActionListener{  
                            override fun onResponse(isSuccess: Boolean, message: String) {  

How To Receive A Voice Call

When you receive an audio call from another SDK user, the Call SDK will display a notification if the device's Android version is greater than or equal to Android 10 (API level 29). Otherwise, the activity you set using the CallManager.setCallActivityClass() method during Call SDK initialization will be launched with the call details. A sample call UI is provided for easy integration.

Caution: Ensure to set the activity class for the Call SDK using CallManager.setCallActivityClass().

How To Answer A Call

Note: If the necessary permissions are not available, the call will be automatically declined even if you attempt to answer it.

                   CallManager.answerCall(object : CallActionListener {  
                      override fun onResponse(isSuccess: Boolean, message: String) {  

How To Decline Call

When you receive an audio call from another SDK user, and your activity is started depending on the Android version, if the user presses the decline button in your call UI, you must call the following SDK method to reject the call and notify the caller.


Steps To Disconnect An Ongoing Call

If you wish to disconnect an audio call either before getting connected or after the conversation has ended, and the user presses the disconnect button in your call UI, you should call the following SDK method.

Note: The method below accepts CallActionListener as an optional parameter; you can pass the listener to receive a disconnect success callback.


How To Make A Group Video Call

The "Make Group Video Call" feature enables users to initiate a video call with multiple SDK users. Utilize the following method to make a group video call:

Note: The method below accepts CallActionListener as an optional parameter; you can pass the listener to receive a disconnect success callback.

 CallManager.makeGroupVideoCall(JID_LIST, GROUP_ID, object : CallActionListener{  
override fun onResponse(isSuccess: Boolean, message: String) {  


TThat’s it!

We hope this article helped you understand the steps to implement chat into your android apps using Kotlin. As you can see, it is trivial and easy to build powerful in-app communication features with MirrorFly SDKs. If you’d like to extend your app functionality with more interactive chat features, our SDKs offer a wide range of options, you can talk to our experts for more details.

Integrate Our Chat SDK In Just 10 Mins!

Add chat features to your Flutter apps - in 10 minutes - with just a few lines of code.

Request Demo
  • chat api
  • video call api
  • voice call
  • sip voip
  • sdk


1. Why use Kotlin for app development?

Developers greatly prefer Kotlin for its simpler and expressive syntax that reduces the boilerplate code & builds android apps faster. Just not these, Kotlin's null safety features are known to prevent errors to the max.

2. Can I build an app with Kotlin?

Yes you can. Kotlin is a modern programming language that was designed to build high performance Android apps with ease. Plus, its interoperability with Java, makes it seamlessly possible to add it to existing Java code. And use is to build cross-platform mobile apps using Kotlin Multi Platform technology.

3. Is Kotlin good for mobile app development?

Of course yes. Kotlin comes as the best option to build mobile apps for Android. Because it offers great interoperability, an advanced feature set, concise syntax, and several other capabilities for creating robust apps.

4. What is Kotlin in app development?

Kotlin is a more advanced programming language used by developers for building Android applications. It is highly interoperable with Java, safe, and offers concise syntax thus making it an easy language for coding.

5. Which is better for app development, Flutter or Kotlin?

Both Kotlin and Flutter serve different purposes. While Flutter is a great framework for creating cross-platform apps with a single codebase, Kotlin is used to build dynamic Android apps. However, recently Kotlin Multi Platform emerged as a new trend these days leaving behind Flutter.

6. Can Kotlin apps run on iOS?

No, Kotlin apps can't run on iOS. As Kotlin is a language used to build Android apps and hence runs on JVM (Java Virtual Machine). However, there are tools like Kotlin Multiplatform and Kotlin Native that allow developers to share codes and make it possible to run on both iOS and Android platforms.


Launch your Own Android & iOS Group Video Call App with Kotlin!

Drive 1 billion + conversations on any Android, iOS, or Web app with 500+ chat features & 100+ UI components.

  • Topic-based Chat
  • Upload Large Files
  • Multi-tenancy support
  • Lite Chat App
  • Hire Dedicated Team
Request Demo