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.98'

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.applozic.mobicomkit.notification.color"
           android:resource="YOUR_NOTIFICATION_COLOR_RESOURCE" /> <!-- Notification color -->
           
<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...
Evernote SDK for Android

Evernote SDK for Android version 2.0.0-RC4 Evernote API version 1.25 Overview This SDK wraps the Evernote Cloud API and provides OAuth authentication

Air Native Extension (iOS and Android) for the Facebook mobile SDK

Air Native Extension for Facebook (iOS + Android) This is an AIR Native Extension for the Facebook SDK on iOS and Android. It has been developed by Fr

Liquid SDK (Android)

Liquid Android SDK Quick Start to Liquid SDK for Android This document is just a quick start introduction to Liquid SDK for Android. We recommend you

AWS SDK for Android. For more information, see our web site:

AWS SDK for Android For new projects, we recommend interacting with AWS using the Amplify Framework. The AWS SDK for Android is a collection of low-le

新浪微博 Android SDK

ReadMe 公告: 鉴于线上服务器出现问题,推荐下载本地aar后上传到自己公司的服务器,保证后续服务稳定, 我们也将尽快重新提供一个稳定的地址供大家使用。 新包地址:https://github.com/sinaweibosdk/weibo_android_sdk/tree/master/2019

Official Appwrite Android SDK 💚  🤖
Official Appwrite Android SDK 💚 🤖

Appwrite Android SDK This SDK is compatible with Appwrite server version 0.8.x. For older versions, please check previous releases. Appwrite is an ope

This App is sending Face capture data over network, built around the latest Android Arcore SDK.
This App is sending Face capture data over network, built around the latest Android Arcore SDK.

AndroidArcoreFacesStreaming From any Android phone ArCore compatible, using this app will send over TCP 5680 bytes messages: The first 5616 bytes is a

Trackingplan for Android SDK
Trackingplan for Android SDK

With Trackingplan for Android you can make sure that your tracking is going as you planned without changing your current analytics stack or code.

Storyblok Kotlin Multiplatform SDK sample (Android, JVM, JS)

storyblok-mp-SDK-sample *WIP* ... a showcase of the Storyblok Kotlin Multiplatform Client SDK. (Android, JVM, JS, iOS, ...) What's included 🚀 • About

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
Desk360 Mobile Chat SDK for Android

Desk360 Chat Android SDK Introduction Desk360 Live Chat SDK is an open source Android library that provides live support to your customers directly fr

null 31 Dec 13, 2022
Sdk-android - SnapOdds Android SDK

Documentation For the full API documentation go to https://snapodds.github.io/sd

Snapodds 0 Jan 30, 2022
Segmenkt - The SegmenKT Kotlin SDK is a Kotlin-first SDK for Segment

SegmenKT Kotlin SDK The SegmenKT Kotlin SDK is a Kotlin-first SDK for Segment. I

UNiDAYS 0 Nov 25, 2022
Frogo SDK - SDK Core for Easy Development

SDK for anything your problem to make easier developing android apps

Frogobox 10 Dec 15, 2022
HubSpot Kotlin SDK 🧺 Implementation of HubSpot API for Java/Kotlin in tiny SDK

HubSpot Kotlin SDK ?? Implementation of HubSpot API for Java/Kotlin in tiny SDK

BOOM 3 Oct 27, 2022
Zendesk-Messaging for Flutter developer

Zendesk Messaging Messaging is a "user-based" chat Live Chat is a "session-based" chat Better UI (Native) Chat history Answer Bot Setup 1. Enable agen

Yii Chen 11 Nov 10, 2022
Simple Discord <-> Minecraft chat integration using webhooks

Minecraft Chat Simple Discord <-> Minecraft chat integration using webhooks Instalacja Plugin należy wrzucić do folderu plugins oraz ustawić URL webho

Oskar 10 Aug 31, 2022
AWS SDK for Android. For more information, see our web site:

AWS SDK for Android For new projects, we recommend interacting with AWS using the Amplify Framework. The AWS SDK for Android is a collection of low-le

AWS Amplify 976 Dec 29, 2022
Countly Product Analytics Android SDK

Countly Android SDK We're hiring: Countly is looking for Android SDK developers, full stack devs, devops and growth hackers (remote work). Click this

Countly Team 648 Dec 23, 2022