Real-time Chat Blog

Easily Build an Android Chat App in One Afternoon

2 min read Michael Carroll on Sep 28, 2016
Try PubNub Today

Free up to 1MM monthly messages. No credit card required.

Subscribe to our newsletter

By submitting this form, you are agreeing to our Terms and Conditions and Privacy Policy.

Good News! We've launched an all new Chat Resource Center. We recommend checking out our new Chat Resource Center, which includes overviews, tutorials, and design patterns for building and deploying m...

Waving Hand

Good News! We’ve launched an all new Chat Resource Center.

We recommend checking out our new Chat Resource Center, which includes overviews, tutorials, and design patterns for building and deploying mobile and web chat.

Take me to the Chat Resource Center →

Building chat applications is easier today than ever before. Technologies supporting low-latency publish/subscribe messaging, user authentication, and other must-have chat features are readily available and easy to use.

For Android developers, the Twitter Fabric platform is one of the best tools for getting a scalable app up and running. PubNub provides the low-latency messaging to power the actual chat messages, user presence monitoring, and chat history storage. Digits is a great option for user authentication.

We wrote two guides to get you well along the way to a fully featured chat app with only about an afternoon’s worth of work.

Part 1: Get Started with Fabric and PubNub

PubNub adds real-time messaging to Twitter Fabric Android apps

 

In this tutorial, you’ll:

  • Log in with Twitter auth.
  • Send chat messages to a PubNub channel (Chat): using the PubNub plugin for real-time messaging and Publish/Subscribe API.
  • Display current and historical chat messages (Chat): using the PubNub plugin and History API.
  • Display a list of what users are online (Presence): using the PubNub plugin and Presence API.

Part 2: Set up Digits User Authentication

With the chat basics in place, you’ll need a method of user authentication to keep user data secure. Digits is an easy to use mobile identity provider that lets you authenticate user with their mobile phone, which increases engagement and makes email validation obsolete.

 

Build authentication for Android chat with Digits and PubNub

 

Although it isn’t covered explicitly, you can combine the user authentication with PubNub Access Manager for fine-grain control over which users have access to which chat channels. You can grant, revoke, and expire tokens both programmatically and manually as needed. All of the 70+ PubNub SDKs come with full end-to-end encryption at no extra cost. So you are pretty much only a couple steps away from the next WhatsApp, selling it for billions of dollars, and buying a Tahitian island. Or something like that.

Oh, and if you’re building a chat app, you definitely need to check out the PubNub BLOCKS catalog for chat applications. BLOCKS lets you program the network to handle application logic like chat translation with IBM Watson, spam filtering, and much more.

More from PubNub

NPP and HIPAA: Notice of Privacy Practices Definition
Healthcare CategoryJan 6, 20235 min read

NPP and HIPAA: Notice of Privacy Practices Definition

A Notice of Privacy Practices (NPP) is one of the requirements of HIPAA and helps patients understand their personal data rights.

Michael Carroll

Michael Carroll

HIPAA Violation Examples
Healthcare CategoryJan 5, 20236 min read

HIPAA Violation Examples

HIPAA violations can be financially expensive and devastating to a brand. Examine some examples of HIPAA violations, and learn...

Michael Carroll

Michael Carroll

HIPAA Technical Safeguards: How To Protect Sensitive Data
Healthcare CategoryJan 5, 20236 min read

HIPAA Technical Safeguards: How To Protect Sensitive Data

HIPAA covered entities must follow the five technical safeguards to achieve HIPAA compliance and prevent data corruption.

Michael Carroll

Michael Carroll