I used Google Workspace for over 15 years in different phases of my career. I’ve used the tool in and out. But when it comes to implementing instant messaging for my business, I wanted something more.
I just didn’t want to use a third-party platform and convince myself it was sufficient. My team and I decided to build a chat app that did exactly what my business needed.
In this article I’ve shared my experience and learning in building a tool like Google Workspace - a globally acclaimed real-time communication solution for instant messaging, audio/ video call, conferencing and meetings.
What you'll learn:
- The necessity for building your own IM app
- What you'll need to build the app
- How you'll build the app (in 24 hrs)
Without any further ado, let’s get started.
Why I Quit Google Workspace?
Google Workspace is good, in fact, great! It worked fine. I used Google Chat for all the conversations with my team. Met them remotely over Google Meet. But something felt off, lately.
What is Google Workspace?
Google Workspace is a collection of cloud computing, collaboration, cloud computing software and products. It includes Google Chat, Meet, Gmail, Drive and more.
I kept hitting walls with the features. Most of them were not aligned to our business needs. That's when building a custom instant messaging platform for our business started making sense.
1. Google Workspace felt a bit restrictive
Google Workspace is generic by design.
I felt out of luck whenever my team had to use one app for communicating with customers, another app to check their CRM, and another to track tasks. Google Workspace lacks the features to meet all our needs in one-place.
2. Concerns over data security & privacy
This part mattered more than I expected.
When everything runs on a third-party platform, I was not sure if ONLY OUR TEAM had the access to our data. Whenever we chat or meet over the app, we share key business data. Our clients connect with us remotely. Their data was also at the risk of flowing through someone else's servers.
Until I learned about self-hosting, I did not understand the risks involved.
3. I can’t rent tools forever
End of the day, Google Workspace is a rental tool. Every time we have a new set of hires, we need to scale up. For every new feature, we need to upgrade the subscription. We kept investing in a tool that was neither ours nor gave us complete control.
Things I Had to be Be Honest About
- Building a full instant messaging app is not an easy joke.
- We've had our challenges. First, it was the expense. The major road-block was the fear of multi-fold expenditure that was in front of us.
- Next, was the technology. Understanding WebRTC was a bit complex, but, I have to be honest that our team aced it.
- We experimented with bots and AI assistants. We also learned that one small DOM change can break almost everything.
- So yes, it's challenging. But if control and lifetime ownership matter to you, building your IM app is a decision you'll never regret.
Building Our Own Google Workspace-Like App: Is It A Good Idea?
Google Workspace has set the bar high for many businesses.
Till date, the giant has a critical role in connecting and collaborating teams across the world. Yet, the tool did not meet 100% of our needs. Its limitations deviated our workflow in multiple business areas.
So, we took inspiration from Workspace and started building our own tool.
Let me give you 3 reasons why we confidently stepped into this project:
1. The entire platform was customized to our business needs
We decided what features we need, what we don’t. We customized every part of our instant messaging platform - from chat features to the color of the button shadow.
Instead of sticking to what we had, we built it all, our way.
2. We got the control of our data and security
Building our own platform made sense when all the data stayed inside our infrastructure. I could actually see things running securely right in front of my eyes.
Initially, thinking about building our own platform felt like a heavily expensive move.
But over time, running our own system turned out to be cheaper and more flexible. It also helped with branding our business. Instead of saying "Join us on Google Meet' users were joining our product, with our very own logo.
In fact, we introduced options where our teams could customize their UI and feel comfortable working around. The overall experience felt more intentional, more polished and honestly more trustworthy.
And because our in-house team controlled the app's infrastructure, we could expand globally to multiple clients and users.
3. Our teams learned to handle everything
I won't pretend it was easy, but it was incredibly worth it. Every step we took in researching about what exactly we need in our instant messaging app got interesting day by day. But the implementation part was quick and simple, with the right choice of tools.
Instead of building chat, video and voice features from scratch, I could assemble a working MVP quickly and go live to my team and customers. We picked a custom CPaaS solution that made it all easy for us. I’ll talk about it in the coming sections.
4. We got a real product, not just an internal tool
We needed team chat + customer chat + AI agents in one tool. Google Workspace did not have them all unified.
We tried combining third-party tools, but soon their platform started feeling clunky. Having this in mind, we started building a product that will do more than just a regular internal messaging app.
Ultimately, all our efforts and investments yielded us a full-fledged product.
The options we discovered for building a Google Workspace clone
After over 3.7 months of research, we had 2 different options in front of us.
Option 1: Writing all the codes ourself
This meant our team writes all the code for each element: chat, video call, voice call, media storage, and AI agents. We will research, write codes, test them and handle it all ourselves.
- Pros: full control of the project, and 100% ownership of intellectual property (IP)
- Cons: extremely high development time and expensive.
Option 2: Using a pre-built instant messaging solution
Instead of doing all the heavy work, use a custom solution that’s designed for the business. It helps build our own instant messaging platform.
- Pros: quick development in a way just exactly how we need it.
- Cons: dependency on third party server (if not self-hosting)
What We Chose & Why?
We went with Option 2: Using a pre-built instant messaging solution and here’s why:
First, my team and I wanted to go with something reliable. Undoubtedly, building a full platform code by code is a good idea. But the moment we were in, we were a small humble team.
We could spend years building the product, but that would stretch our growth longer. We may burn out our excitement and sidetrack from our purpose.
Our team went with the ultimate solution: choosing MirrorFly instant messaging solution.
So far, this has been the wisest decision we have made at a very crucial time in our project.
MirrorFly offered us:
- The customization and flexibility we were looking for.
- The data control and access to source code, so we can be confident everything we build out of it stays only with us.
- Choice of deploying the platform on our AWS server. MirrorFly supports self-hosting, and we were not locked into limitations.
- Customizing security features in and out, just as we needed it.
- White-labeling our platform with our own brand logo, colors and elements.
- Finally implementing the AI features we were long interested in trying out on our platform.
Now The Good Stuff: The Code
In this project, I’ll explain how to build a platform like Google Workspace with instant messaging as its primary feature.
We’ll add voice calling, video calling and AI agents in a sequential order, to unify all collaboration, team management and customer engagement tools in one place.
We’ll add MirrorFly instant messaging SDK to an Android app. If you do not have an app already, make use of this sample app to get started with.
What you’ll need:
For this project, you need to make sure your system meets the following requirements:
- Android Lollipop 5.0 (API Level 21) or above
- Java 7 or higher
- Gradle 8.6.0 or higher
- Kotlin 2.0.20 or higher
- targetSdkVersion,compileSdk 35
Note: If you’re using Chat SDK version 7.13.27 or higher, set your target SDK version to 35. (Migration of ChatSDK to Android 15)
Get SDK License Key
Since we will build the entire project with MirrorFly’s instant messaging SDK, we will need the solution along with a valid license key.
If you do not have one already,
- Contact MirrorFly Team
- Discuss your requirements
- Get the solution and license key
Setting up Android project + dependencies
We started the project with a regular Android app in Android Studio. To bring the SDK into the project, we added the MirrorFly’s repository to Gradle and included their SDK dependencies.
- Step 1: Create a new project or Open an existing project in Android Studio
- Step 2: Since we were using Gradle 6.8 or higher, we added the required code to the settings.gradle file.
Note: For Gradle 6.7 or an older version, the same code has to be added to the root build.gradle file instead.
dependencyResolutionManagement {
repositories {
mavenCentral()
google()
jcenter()
maven {
url "https://repo.mirrorfly.com/release"
}
}
}
Jcenter
Step 3: We added the following dependencies to the app/build.gradle file.
Step 3: We added the following dependencies to the app/build.gradle file.
Step 4: When we import the library files, there are chances the old and new files might have compatibility issues. Many old libraries were built with Support Libraries, but the new projects now use AndroidX.
A few outdated libraries might not work along with the new libraries. To fix this automatically, we added the following line:
android.enableJetifier=true
Step 5: The app cannot work without access to the internet. They cannot call APIs, send data to the server or use the chat, video or real-time features.
So to give the app permission to access the internet, open the AndroidManifest.xml and add below permissions.
<uses-permission android:name="android.permission.INTERNET" />
Initialize Chat SDK
Before you can use the instant messaging features in your app, you will need to make sure 2 things are done:
- Your Chat SDK is active.
- Ensure your app is authorized to use the SDK.
That’s exactly what this step does.
We particularly did this inside the Application Class so the app loads the SDK first as soon as it launches, before loading anything else.
ChatManager.initializeSDK("LICENSE_KEY", (isSuccess, throwable, data) -> {
if(isSuccess){
Log.d("TAG", "initializeSDK success ");
}else{
Log.d("TAG", "initializeSDK failed with reason "+data.get("message"));
}
});
Add MirrorFly Application

Now that we’ve known the Application class runs first when the app starts, we created a starting point MyApplication to set up the chat SDK, databases, analytics and configurations.
But our Android App doesn’t automatically know that it should use MyApplication, we explicitly define it in the android:name = “.MyApplication”.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.uikitapplication">
<application
android:name=".MyApplication" // Add this line.
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
...
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
This way, even before the app is opened, the app will launch MyApplication first, run the onCreate() function inside it, initialize the chat SDK and then load the MainActivity.
Without this line, the chatSDK will not be initialized, as the app does not know to use a custom Application class.
Registration
This step lets us create a user at the backend of the chat system. Make sure you call this method only once until logging out of the session.
Calling this again is like you’re recreating the same account one more time. This can cause errors or duplicate sessions.
FlyCore.registerUser(USER_IDENTIFIER, (isSuccess, throwable, data ) -> {
if(isSuccess) {
Boolean isNewUser = (Boolean) data.get("is_new_user"); // true - if the current user is different from the previous session's logged-in user, false - if the same user is logging in again
String userJid = (String) data.get("userJid"); //Ex. 12345678@xmpp-preprod-sandbox.mirrorfly.com (USER_IDENTIFIER+@+domain of the chat server)
JSONObject responseObject = (JSONObject) data.get("data");
String username = responseObject.getString("username");
} else {
// Register user failed print throwable to find the exception details.
}
});
Connect to the Chat Server
After we create a user, the Chat SDK automatically tries to connect to the server by itself.
- It takes care of the app’s state:
- If the app goes in the background, it may disconnect.
- If the app comes back to the foreground, it tries to reconnect.
- If the internet drops, it waits and tries again to reconnect.
So this part actually takes care that the app is connected to the chat system in real-time, automatically.
Observe Connection Events
Even though the SDK connects on its own, we still need a way to know what’s happening with that connection.
That’s what this listener does:
ChatManager.setConnectionListener(new ChatConnectionListener() {
@Override
public void onConnected() {
// Write your success logic here to navigate Profile Page or
// To Start your one-one chat with your friends
}
@Override
public void onDisconnected() {
// Connection disconnected
}
@Override
public void onConnectionFailed(@NonNull FlyException e) {
// Connection Not authorized or Unable to establish connection with server
}
@Override
public void onReconnecting() {
// Automatic reconnection enabled
}
});
Preparing user JID
A JID (Jabber ID) is basically the user’s official chat address on the server.
To generate a JID for any user, use the below method.
FlyUtils.getJid(USER_NAME)
Send a One-to-One Message
Here you are creating a message object. Then you set who you are sending it to.
TextMessage textMessage = new TextMessage();
textMessage.setToId(TO_JID);
textMessage.setMessageText(TEXT);
FlyMessenger.sendTextMessage(textMessage, (isSuccess, error, chatMessage) -> {
if (isSuccess) {
// you will get the message sent success response
}
});
Receive a One-to-One Message
You need to set your app on alert mode using the observer MessageEventsListener to receive any message.
ChatEventsManager.setupMessageEventListener(new MessageEventsListener() {
@Override
public void onMessageReceived(@NotNull ChatMessage message) {
//called when the new message is received
}
});
Inside this method:
@Override
public void onMessageReceived(@NonNull ChatMessage message) {
super.onMessageReceived(message);
// received message object
}
This callback fires only when a new message arrives from another user.
By this step, we’ve created a basic app with instant messaging features to send and receive messages.
Next actions
Continue building your Workspace clone by adding features like video calling, voice calling and AI agents. Add advanced messaging features and then follow the steps to add other collaboration features.
This guide has covered the first phase of the project. To continue with the rest of the features, check out the SDK documentation for:
On completing these steps, we were able to build a fully-functional AI-powered instant messaging platform. We’ll be writing more about our experience here. See you in the next one!

Top comments (0)