Android SDK


Ertc SDK is secure, easy to integrate, deploy and manage.

Following principles are followed during development

Modularity: Code is segregated into multiple modules and follow chain of responsibility model

Ease of Integration: Maven artifacts can be downloaded from a public hosted url . ERTC sdk can be integrated into any mobile app within minutes

Scalability: SDK is highly scalable and can support Enterprise traffic

Built on Latest Tech Stack

Data ownership: SDK provides a data layer to effectively manage and control data

Firebase powered by Google: Highly reliable and scalable

Reactive using RxAndroid


  • Individual messages
  • Push notifications
  • Text, Image,Video,Audio messages
  • Typing Indicators.
  • Delivered and Read receipts.
  • Chat history
  • Chat user list
  • Contact details


To start with an existing app , just initialize the sdk in your Application’s onCreate() method and start using the SDK features

Please note that we are using Java 8 in our sdk, so you have to add Java 8 support in compile options

We are using AndroidX in our sdk, so please add AndroidX support in

Once you do these pre-requisites, you are ready to start using our sdk

API Documentation

To validate the namespace of your app

    Consumer<Result> { this.success(it) }, error

How to login with username and password

login(AccountDetails details);

E.g. :-
eRTCSDK.tenant().login(AccountDetails.username(username, password)).subscribe(
   Consumer { this.success(it) }, error

Forgot Password:

Provide namespace to get the password in the mail:

   Consumer { this.success(it) }, error

Change Password

eRTCSDK.tenant().changePassword(AccountDetails.changePwd(oldPassword, newPassword)).subscribe(
   Consumer { this.success(it) }, error

To initiate chat , you have to create thread with the recepient:"testthread",   //testhread is thread
name, you can choose to not provide

Code Example:

   //open chat screen to begin chatting
}, {
   //handle error

To send a text message :

API signature : sendMessage(String text, String threadId);
String textMessage = “Hi!! What are you up to”;, threadID);

To send media message :

sendMedia(String mediaPath, String threadId, String mediaType)
//mediaType = ‘image’/’audio’/’video’
    filePath,                 //filePath
    messageRecord.msgType       //msgType = ’image’/’audio’/’video’

Code Example:

For capturing photos:

<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="">
<external-path name="external_files"
path="." />

And in AndroidManifest.xml , add this under application tag


To get file for startTakePhotoAcitivty , use this

fun getPhotoImageFile(): File {
var cameraImage:File? = null
val mediaSelector = MediaSelector()
cameraImage = mediaSelector.getPictureFile()
return cameraImage;
fun capturePhoto(activity: Activity, cameraImage: File, requestCode: Int) {
.withPermanentDenialDialog(activity.getString(R.string.attachment_take_photos_denied)) .onAllGranted {
val mediaSelector = MediaSelector()
mediaSelector.startTakePhotoActivity(activity, cameraImage)

Choose Photos:

fun selectGallery(activity: Activity, requestCode: Int) {
.onAllGranted {
val mediaSelector = MediaSelector()

How to Add the eRTC Client SDK to your Android App


To download the SDK, you will need to include the repository manually:

Add repository.

repositories {
   maven { url "" }

Then add this to your dependencies area.

implementation 'com.ripbull.ertcsdk:coreSdk:1.0.0'

You also need to enable Java 8.

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8

Android X

Make sure you've added the following to your file.


Initializing the Chat SDK

Now open your applications's main class and find the onCreate method. Add the following to setup the Chat SDK:

try {
   val config = Configuration.Builder()

   // SDK initialize

} catch (ChatSDKException e) {
   // Handle any exceptions

How to Send Chat Text Message

A chat between two users is considered as a thread of communication. To initiate chat between users, you need to create threads and send message over that thread ID.
To do that :

Here corresponds to the id of the user, you need to initiate chat with. Create Thread method takes two params, one is thread name and the second one is user id
//use the thread id created from above to start text messaging
String textMessage = “This is a text message”;, threadID);

How to create Threads for Chat?

Here corresponds to the id of the user , you need to initiate chat with. createThread method takes two params, one is thread name and the second one is user id

How to send Chat message?

Use the thread id created from above to start text messaging

String textMessage = “This is a text message”;, threadID);

How to handle permissions

How To use attachment library :

E.g. :

Take Photos :

fun capturePhoto(activity: Activity, requestCode: Int) {

   .withPermanentDenialDialog(“Denied Permission”)
   .onAllGranted {
      val mediaSelector = MediaSelector()
      mediaSelector.startTakePhotoActivity(activity, MediaSelector.Result {


How to send media message :
    Message,                   //filePath
    messageRecord.msgType       //msgType = ’image’/’audio’/’video’

How to Implementation of Notifications / FCM module:-

You need FCM registration before Login API. for that you write below line in your application


For redirection to an acitivity , say MainActivity, You need to set Intent using below code

val intent = Intent(applicationContext,
intent.flags = Intent.FLAG_ACTIVITY_SINGLE_TOP or

To manage thread based notification, When user clicked on Notification you need to write below piece of code(e.g. In MainActivity)

override fun onNewIntent(intent: Intent?) {
   if (intent != null) {



  • Core SDK module
  • Permission module
  • Attachment module
  • Data Module
  • MQTT module
  • Analytics module
  • Core Http Module (Rest Apis)
  • Core Encryption