Android Real Time Chat & Messaging SDK

Overview

Android Chat SDK

Overview

Applozic brings real-time engagement with chat, video, and voice to your web, mobile, and conversational apps. We power emerging startups and established companies with the most scalable and powerful chat APIs, enabling application product teams to drive better user engagement, and reduce time-to-market.

Customers and developers from over 50+ countries use us and love us, from online marketplaces and eCommerce to on-demand services, to Education Tech, Health Tech, Gaming, Live-Streaming, and more.

Our feature-rich product includes robust client-side SDKs for iOS, Android, React Native, and Flutter. We also support popular server-side languages, a beautifully customizable UI kit, and flexible platform APIs.

Chat, video, and audio-calling have become the new norm in the post-COVID era, and we're bridging the gap between businesses and customers by delivering those exact solutions.

Getting Started

To integrate android chat library into your android app, signup at Applozic to get the App ID.

Documentation: Applozic Android Chat & Messaging SDK Documentation

Step 1: Add the following in your build.gradle dependency:

implementation 'com.applozic.communication.uiwidget:mobicomkitui:5.97.1'

Add the following in gradle android target:

android {

        packagingOptions {           
           exclude 'META-INF/DEPENDENCIES'      
           exclude 'META-INF/NOTICE'         
           exclude 'META-INF/LICENSE'      
           exclude 'META-INF/LICENSE.txt'    
           exclude 'META-INF/NOTICE.txt' 
           exclude 'META-INF/ECLIPSE_.SF'
           exclude 'META-INF/ECLIPSE_.RSA'
         }    
    }               

Step 2: Addition of Permissions,Activities, Services and Receivers in androidmanifest.xml:

Note: Add meta-data, Activities, Services and Receivers within application Tag <application> </application>

Note: Add Permissions outside the application Tag <application>


<meta-data android:name="com.applozic.application.key"
           android:value="<YOUR_APPLOZIC_APP_ID" /> <!-- Applozic App ID -->

<meta-data android:name="com.applozic.mobicomkit.notification.smallIcon"
           android:resource="YOUR_LAUNCHER_SMALL_ICON" /> <!-- Launcher white Icon -->
           
<meta-data android:name="com.google.android.geo.API_KEY"
           android:value="YOUR_GEO_API_KEY" />  <!--Replace with your geo api key from google developer console  --> 
<!-- For testing purpose use AIzaSyAYB1vPc4cpn_FJv68eS_ZGe1UasBNwxLI
To disable the location sharing via map add this line ApplozicSetting.getInstance(context).disableLocationSharingViaMap(); in onSuccess of Applozic UserLoginTask -->   
            
<meta-data android:name="com.package.name" 
           android:value="${applicationId}" /> <!-- NOTE: Do NOT change this, it should remain same i.e 'com.package.name' -->
                     

Note: If you are not using gradle build you need to replace ${applicationId} with your Android app package name

Define Attachment Folder Name in your string.xml.

<string name="default_media_location_folder">YOUR_APP_NAME</string> 

Paste the following in your androidmanifest.xml:

<activity android:name="com.applozic.mobicomkit.uiwidgets.conversation.activity.ConversationActivity"
           android:configChanges="keyboardHidden|screenSize|smallestScreenSize|screenLayout|orientation"
           android:label="@string/app_name"
           android:parentActivityName="<APP_PARENT_ACTIVITY>"
           android:theme="@style/ApplozicTheme"
           android:launchMode="singleTask"
           tools:node="replace">
      <!-- Parent activity meta-data to support API level 7+ -->
<meta-data
           android:name="android.support.PARENT_ACTIVITY"
           android:value="<APP_PARENT_ACTIVITY>" />
 </activity>               

Replace APP_PARENT_ACTIVITY with your app's parent activity.

Step 3: Register user account:

User user = new User();          
user.setUserId(userId); //userId it can be any unique user identifier
user.setDisplayName(displayName); //displayName is the name of the user which will be shown in chat messages
user.setEmail(email); //optional  
user.setAuthenticationTypeId(User.AuthenticationType.APPLOZIC.getValue());  //User.AuthenticationType.APPLOZIC.getValue() for password verification from Applozic server and User.AuthenticationType.CLIENT.getValue() for access Token verification from your server set access token as password
user.setPassword(""); //optional, leave it blank for testing purpose, read this if you want to add additional security by verifying password from your server https://www.applozic.com/docs/configuration.html#access-token-url
user.setImageLink("");//optional,pass your image link

 Applozic.connectUser(context, user, new AlLoginHandler() {
                @Override
                public void onSuccess(RegistrationResponse registrationResponse, Context context) {
                    // After successful registration with Applozic server the callback will come here 
                }

                @Override
                public void onFailure(RegistrationResponse registrationResponse, Exception exception) {
                    // If any failure in registration the callback  will come here 
             }
   });                                      

If it is a new user, new user account will get created else existing user will be logged in to the application. You can check if user is logged in to applozic or not by using Applozic.isConnected(context)

Step 4: Push Notification Setup

Go to Applozic Dashboard, Edit Application -> Push Notification -> Android -> GCM/FCM Server Key.

Firebase Cloud Messaging (FCM) is already enabled in my app

Add the below code and pass the FCM registration token:

1. In UserLoginTask "onSuccess" (refer Step 3)

if(MobiComUserPreference.getInstance(context).isRegistered()) {
  Applozic.registerForPushNotification(context, registrationToken, new AlPushNotificationHandler() {
                @Override
                public void onSuccess(RegistrationResponse registrationResponse) {
                   
                }

                @Override
                public void onFailure(RegistrationResponse registrationResponse, Exception exception) {

                }
    });
}

2. In your FcmListenerService onNewToken(Token registrationToken) method

if (MobiComUserPreference.getInstance(this).isRegistered()) {
     new RegisterUserClientService(this).updatePushNotificationId(registrationToken);
}
For Receiving Notifications in FCM

Add the following in your FcmListenerService in onMessageReceived(RemoteMessage remoteMessage)

 if (MobiComPushReceiver.isMobiComPushNotification(remoteMessage.getData())) {
           MobiComPushReceiver.processMessageAsync(this, remoteMessage.getData());
           return;
   }

GCM is already enabled in my app

If you already have GCM enabled in your app, add the below code and pass the GCM registration token:

1. In UserLoginTask "onSuccess" (refer Step 3)

if(MobiComUserPreference.getInstance(context).isRegistered()) {
  Applozic.registerForPushNotification(context, registrationToken, new AlPushNotificationHandler() {
                @Override
                public void onSuccess(RegistrationResponse registrationResponse) {
                   
                }

                @Override
                public void onFailure(RegistrationResponse registrationResponse, Exception exception) {

                }
     });
}

2. At the place where you are getting the GCM registration token in your app.

if (MobiComUserPreference.getInstance(this).isRegistered()) {
     new RegisterUserClientService(this).updatePushNotificationId(registrationToken);
}
For Receiving Notifications In GCM

Add the following in your GcmListenerService in onMessageReceived

if(MobiComPushReceiver.isMobiComPushNotification(data)) {            
        MobiComPushReceiver.processMessageAsync(this, data);               
        return;          
}                                          

Don't have Android Push Notification code ?

To Enable Android Push Notification using Firebase Cloud Messaging (FCM) visit the Firebase console and create new project, add the google service json to your app, configure the build.gradle files in your app ,finally get server key from project settings and update in
Applozic Dashboard under Push Notification -> Android -> GCM/FCM Server Key.

In case, if you don't have the existing FCM related code, then copy the push notification related files from Applozic sample app to your project from the below github link

Github push notification code link

And add below code in your androidmanifest.xml file

<service android:name="<CLASS_PACKAGE>.FcmListenerService"
android:stopWithTask="false">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
</service>

Setup PushNotificationTask in UserLoginTask "onSuccess" (refer Step 3).

Applozic.registerForPushNotification(context, Applozic.getInstance(context).getDeviceRegistrationId(), new   AlPushNotificationHandler() {
                @Override
                public void onSuccess(RegistrationResponse registrationResponse) {
                   
                }

                @Override
                public void onFailure(RegistrationResponse registrationResponse, Exception exception) {

                }
    });

Step 5: For starting the messaging activity:

Intent intent = new Intent(this, ConversationActivity.class);            
startActivity(intent);                               

For starting individual conversation thread, set "userId" in intent:

Intent intent = new Intent(this, ConversationActivity.class);            
intent.putExtra(ConversationUIService.USER_ID, "receiveruserid123");             
intent.putExtra(ConversationUIService.DISPLAY_NAME, "Receiver display name"); //put it for displaying the title.  
intent.putExtra(ConversationUIService.TAKE_ORDER,true); //Skip chat list for showing on back press 
startActivity(intent);

Step 6: On logout, call the following:

Applozic.logoutUser(context, new AlLogoutHandler() {
                @Override
                public void onSuccess(Context context) {
                    
                }

                @Override
                public void onFailure(Exception exception) {

                }
        });     

Trying out the demo app:

Open project in Android Studio to run the sample app in your device. Send messages between multiple devices.

Display name for users: You can either choose to handle display name from your app or have Applozic handle it. From your app's first activity, set the following to disable display name feature: ApplozicClient.getInstance(this).setHandleDisplayName(false); By default, the display name feature is enabled.

Documentation:

For advanced options and customization, visit Applozic Android Chat & Messaging SDK Documentation

Changelog

Changelog

Features:

One to one and Group Chat

Image capture

Photo sharing

File attachment

Location sharing

Push notifications

In-App notifications

Online presence

Last seen at

Unread message count

Typing indicator

Message sent, Read Recipients and Delivery report

Offline messaging

User block / unblock

Multi Device sync

Application to user messaging

Customized chat bubble

UI Customization Toolkit

Cross Platform Support (iOS, Android & Web)

Sample source code to build messenger and chat app

https://github.com/AppLozic/Applozic-Android-SDK/tree/master/app

Help

We provide support over at [StackOverflow] (http://stackoverflow.com/questions/tagged/applozic) when you tag using applozic, ask us anything.

Applozic is the best android chat sdk for instant messaging, still not convinced? Write to us at [email protected] and we will be happy to schedule a demo for you.

Free Android Chat SDK

Special plans for startup and open source contributors, write to us at [email protected]

Github projects

Android Chat SDK https://github.com/AppLozic/Applozic-Android-SDK

Web Chat Plugin https://github.com/AppLozic/Applozic-Web-Plugin

iOS Chat SDK https://github.com/AppLozic/Applozic-iOS-SDK

You might also like...
Android Combined Application for chat, audio/video calls, and broadcast to millions of web and app users using VdoTok SDK.
Android Combined Application for chat, audio/video calls, and broadcast to millions of web and app users using VdoTok SDK.

Android Combined Application for chat, audio/video calls, and broadcast to millions of web and app users using VdoTok SDK.

Email-based instant messaging for Android.
Email-based instant messaging for Android.

Delta Chat Android Client This is the Android client for Delta Chat. It is available on F-Droid and the Google Play Store. The APK can also be downloa

Official Android client for the Kontalk messaging system

This is the official Android client for the Kontalk messaging system. It always implements the latest protocol.

Signal is a messaging app for simple private communication with friends.

Signal Android Signal is a messaging app for simple private communication with friends. Signal uses your phone's data connection (WiFi/3G/4G) to commu

SayHi! is an instant messaging app that allows users to send text messages to other people using the app
SayHi! is an instant messaging app that allows users to send text messages to other people using the app

SayHi SayHi! is an instant messaging app that allows users to send text messages to other people using the app 📷 Screen Shots 🔥 Features OTP Verific

Messaging API: Connect to PostgreSQL and Kafka to obtain and manage cars inventory

Messaging-API In this simple API, we connect to PostgreSQL and Kafka to obtain a

An instant messaging and audio-video calling app
An instant messaging and audio-video calling app

Babble Babble is a chatting and calling application for anyone with an Android phone and an Internet connection. Just sign up using your phone number

A hybrid chat android application based on the features of Instagram and Whatsapp having UI just as Telegram.
A hybrid chat android application based on the features of Instagram and Whatsapp having UI just as Telegram.

A hybrid chat android application based on the features of Instagram and Whatsapp having UI just as Telegram.

A private-chat-only Android App for Secure Scuttlebutt
A private-chat-only Android App for Secure Scuttlebutt

Tremola README Tremola is a Secure Scuttlebutt (SSB) client for Android that only supports private chat. Tremola aims at having the same functionality

Releases(v5.103.0)
  • v5.103.0(Dec 10, 2021)

    Internal cleanup and refactoring:

    • Added javadocs
    • Added nullabilty annotations
    • Re-organised code
    • Deprecated un-used, buggy classes and methods
    Source code(tar.gz)
    Source code(zip)
  • v5.102.0(Aug 20, 2021)

    Note: This is an important update because of the MQTT client changes. Please make sure you update.

    • MQTT Client Retry Policy Change: The MQTT client now will retry 3 times per connection session. Each will happen after a random interval between 1-40 minutes.

    • Public API reference updated.

    • Some refactoring.

    Source code(tar.gz)
    Source code(zip)
  • v5.101.0(Jun 29, 2021)

  • v5.100.0(Jun 11, 2021)

    Features:fire::

    • Update to Android API Level 30 :tada:
    • Added Mentions support:grey_exclamation:
    • Migrate JobIntentService classes to WorkerManager
    • Video attachments will now show thumbnails

    Bugs/Fixes:hammer::

    • UI Kit: Sender cannot interact suggested replies and submit button rich message
    Source code(tar.gz)
    Source code(zip)
  • v5.99.0(May 9, 2021)

    • Added client SDK side channel descriptions support. Data for channel decription goes in the channel metadata and is recognized by the UIKit.
    • Added client SDK side support for admin only chat functionality in channel. Flag for request goes in the Channel metadata.
    • Added config files for Jfrog Artifactory.
    • Added support for custom fragment transitions.

    Bug Fixes:

    • Fixed bug with contact profile images dissapearing.
    Source code(tar.gz)
    Source code(zip)
  • v5.98(Mar 26, 2021)

    • Deletion of logged in user will now be detected and appropriate message will be displayed.
    • Name of sender will be shown for the received messages in the conversation list for groups. (OPTIONAL)
    • Group lists will now also show group members, below the group name.
    • Support for custom date/time formats in the UI.
    • Notification color can now be set, from the manifest.
    • BUG FIX: link preview not working for certain shortened URLs fixed.
    Source code(tar.gz)
    Source code(zip)
  • v5.97.1(Feb 18, 2021)

    • add option to pin contact to top in contact screen
    • add retry download conversation view in case of network fail in conversation list
    • add option to hide exit conversation in conversation screen
    • fix app closing in case of no parent activity for conversation activity on takeOrder false
    Source code(tar.gz)
    Source code(zip)
  • v5.97(Jan 28, 2021)

    • Changed target to Android API level 29
    • Clicking on contact profiles now sends a profile click broadcast
    • Internal updates for supporting audio video calls
    Source code(tar.gz)
    Source code(zip)
  • v5.96.1(Jan 12, 2021)

  • v5.96(Dec 30, 2020)

  • v5.95.1(Dec 17, 2020)

  • v5.95(Dec 10, 2020)

  • v5.94(Nov 30, 2020)

  • v5.93(Nov 6, 2020)

    Enhancement :

    • Added support for deleting messages for all in the open group.
    • Added API method and task for group list fetching.
    • Security Improvement in KeyGenerator for key pair.

    Fixes :

    • Fixed the NPE in Keystore
    Source code(tar.gz)
    Source code(zip)
  • v5.92(Oct 14, 2020)

  • v5.80.1(Jul 30, 2020)

  • v5.80(Jun 24, 2020)

    • Security enhancements:
      1. MQTT connection will now require a user name and password to publish data to any topic.
      2. The password for MQTT will be refreshed in every 30 days, this is handled for pre-built UI. For customUI users, if you want to use the default progress dialog when the token refreshes, replace Applozic.connectPublish(context) method with Applozic.connectPublishWithVerifyToken(context, loadingMessageString) in your code. If you want to use your own dialog, refer to Applozic.connectPublishWithVerifyToken method implementation.
    • Added methods to use custom MQTT topic in the SDK.
    • Performance improvement: The read status of the message will be updated via MQTT instead of http call.
    • Added restricted words support for attachment caption text.
    • Added APIs to get support message list based on custom statuses.
    • Fixed issue where send button was not visible on click deleting the message with attachment.
    • Fixed issue where blank screen was displaying on back press of contact screen when hideGroupTab setting is enabled.
    • Fixed issue where contact status was not dispaying when the conversation was switched from notification.
    Source code(tar.gz)
    Source code(zip)
  • 5.77(May 16, 2020)

    Enhancement :

    • Added a listener to filter attachment based on custom logic

    Fixes :

    • Fixed the issue where the old conversations list was not loading on a scroll in some cases.
    Source code(tar.gz)
    Source code(zip)
  • 5.76(Mar 27, 2020)

  • v5.51.4(Mar 27, 2020)

    Fixes

    • Fixed the update display name issue in case of launching a chat with another user.

    • You can refer this branch for updates on SDK without android X https://github.com/AppLozic/Applozic-Android-SDK/tree/without-androidX

    Source code(tar.gz)
    Source code(zip)
  • v5.51.1(Feb 3, 2020)

    • Removed read contact and phone state permission
    • Removed device contact sync feature
    • Removed contact sharing feature
    • Fixed attachment upload issue on first install.
    Source code(tar.gz)
    Source code(zip)
  • v5.73(Jan 31, 2020)

  • 5.72(Jan 29, 2020)

    • Added setting to set the parent activity of chat programmatically Example: ApplozicSetting.getInstance(context).setParentActivity(MainActivity.class.getName());
    • Added Mute all notifications for user from platform API
    Source code(tar.gz)
    Source code(zip)
  • v5.70(Jan 10, 2020)

  • v5.66(Dec 31, 2019)

    • MQTT message encryption.
    • Added 2 more paramters in delete group API: updateClientGroupId and resetCount
    • RichMessage UI fixes on the Sender side. Support for Image type and multiple buttons type rich messages added.
    • isDeepLink option in link type rich messages
    • Changed the authority of applozic file provider to applozic.provider in order to avoid conflicts with the same authority.
    Source code(tar.gz)
    Source code(zip)
  • v5.65(Dec 2, 2019)

  • v5.64(Oct 18, 2019)

  • v5.62(Sep 27, 2019)

    Features

    • Updated glide version to 4.9.0
    • Added Message search APIs

    Improvements

    • Fixed typing indicator issue.
    • Fixed image not sending issue when regex in settings file is empty.
    • Fixed video not sending issue.
    • Fixed MQTT not connecting when device goes idle for long time with chat open.
    Source code(tar.gz)
    Source code(zip)
  • 5.61(Sep 6, 2019)

  • v5.60(Sep 4, 2019)

    Features 1. AndroidX migration. 2. Option to enable/disable one to one chat. 3. Option to set regex to block message that matches the pattern. 4. UserId validation before login. 5. Option to report a message. Fixes 1. Fixed issue where logout was taking too long to respond. 2. Other crash fixes.

    Source code(tar.gz)
    Source code(zip)
Owner
Applozic
Chat & Messaging SDK for android, iOS and web apps built with MQTT protocol
Applozic
Open Source Messenger App For Android - Real-time Messaging, Voice and Video Calls

Open Source Messenger App For Android - Real-time Messaging, Voice and Video Calls

mesibo 630 Dec 7, 2022
💙 Android sample Avengers chat application using Stream Chat SDK based on MVVM (ViewModel, Coroutines, Room, Hilt, Repository) architecture.

Avengers Chat AvengersChat is a demo application based on modern Android tech stacks and Stream Chat SDK. Previews Download Go to the Releases to down

Jaewoong Eum 352 Dec 25, 2022
Server/Client Chatting application that allows to choose to chat in a group chat or privately to a specific connected user

ktor_chatting_application Server/Client Chatting application that uses Ktor webs

null 10 Jun 14, 2022
This is a Bluetooth operational Chat-App developed using Kotlin which shows the list of available devices nearby and paired devices, upon clicking you can start chat

This is a Bluetooth operational Chat-App developed using Kotlin which shows the list of available devices nearby and paired devices, upon clicking you can start chat ... VOILA ???? It is still in its early stages of development and currently let user to one-time chat at a time. It is under heavy development ??

Shalu Ambasta 3 Jan 10, 2022
Multi Lingual Chat app - A modern chat application that allows users to translate text messages into their preferred language

Multi Lingual Chat app - A modern chat application that allows users to translate text messages into their preferred language

Manjunath Nayak 0 Jan 18, 2022
Chat App is built to demonstrate a simple end-to-end chat encryption using RSA and AES algorithms

End-to-End Encrypted Chat ?? Chat App is built to demonstrate a simple end-to-end chat encryption using RSA and AES algorithms Built With ⚒️ Jetpack C

Team Matrix 6 Dec 23, 2022
Shit Chat is a realtime chat application made with Kotlin.

Shit Chat Shit Chat is a realtime chat application made with Kotlin. Screeshots : Login UI Sign Up UI User List UI Chat UI Features Store Chat on Fire

Vishal Singh 2 Oct 26, 2022
A simple real-time chatting application using android

In this project we have created a simple real-time chatting application using android. In this project we can chat with a registered user in the app. We can also set profile photo, about, name. After chatting with registered user we can also logout from the app and we can login, whenever we want .

Shankar Karande 3 Sep 26, 2022
Kommunicate.io Android Chat SDK for Customer Support

Kommunicate Android Chat SDK for Customer Support An Open Source Android Live Chat SDK for Customer Support Overview Kommunicate provides open source

Kommunicate 68 Jan 3, 2023
AvengersChat is a demo application based on modern Android tech stacks and Stream Chat SDK.

?? Android sample Avengers chat application using Stream Chat SDK based on MVVM (ViewModel, Coroutines, Room, Hilt, Repository) architecture.

Stream 352 Dec 25, 2022