Real time Messaging

Overview

This guide will show you how to configure an Android app to handle real-time messaging such as a chat client or group texting app. There are several approaches you can take to achieve this.

PubNub

One approach is to use the PubNub service to send and receive real-time messages. PubNub enables low-latency real-time apps that work across any number of platforms including Android, iOS, and Javascript.

Setup

PubNub can be setup very quickly using this setup guide for their Android SDK. In short, their SDK is contained within two JARs that need to be added to your app's libs folder. You can also watch this setup video to get a better look.

Usage

PubNub works by allowing any number of clients to subscribe and send messages to any number of different channels. All clients subscribed to a channel will get messages sent to that channel in real-time.

If we want to use PubNub as a service such that the messages are being received even when the app isn't open, we can check out this simple example which describes how to setup a PubNubService which subscribes to a channel and receives messages starting up as soon as the device boots. This solution is expanded on in this stackoverflow post.

Contus Fly

Contus Fly, an instant chat app solution provide chat API for a website and messaging SDK for Android & iOS, equipped with voice/video calling feature has set on a journey to create seamless connectivity in powering the video and voice functionality through WebRTC.