explaingit

zomato/pulse-droid

26KotlinAudience · developerComplexity · 3/5ActiveSetup · moderate

TLDR

Kotlin library that simplifies MQTT messaging in Android apps, handling connection management, subscriptions, and reconnection logic with a command-based API.

Mindmap

mindmap
  root((pulse-droid))
    What it does
      MQTT wrapper
      Command submission
      Auto-reconnect
    Key features
      Retry policies
      Health monitoring
      Auto-subscriptions
      Listener callbacks
    Tech stack
      Kotlin
      Eclipse Paho
      Android
    Use cases
      Push notifications
      Real-time updates
      Device signalling
    Setup
      Bridge pattern
      Application class init
      Dependency injection

Things people build with this

USE CASE 1

Send and receive push notifications to Android devices over a persistent MQTT connection.

USE CASE 2

Stream real-time order status updates from a backend server to a mobile app.

USE CASE 3

Implement device-to-server signalling for IoT or mobile apps that need low-latency messaging.

USE CASE 4

Build chat or messaging features that rely on a lightweight pub/sub protocol instead of HTTP polling.

Tech stack

KotlinEclipse Paho MQTTAndroidJetpack WorkManagerGson

Getting it running

Difficulty · moderate Time to first run · 30min

Requires implementing a bridge interface and initializing in your Application class; depends on Eclipse Paho MQTT client and Android framework.

No license information provided in the repository documentation.

In plain English

pulse-droid is a Kotlin library from Zomato that wraps the Eclipse Paho MQTT client to make it easier to use inside Android apps. MQTT is a lightweight messaging protocol commonly used for things like push notifications, real-time order updates, or device-to-server signalling, where small messages move between an app and a broker over a long-lived connection. The library is published as a kit called PulseMqttKit and the README is mostly an integration guide for Android developers. You start by creating an instance of PulseMqttKit inside your Application class and calling initialize, passing in a context and a bridge object that you implement. The bridge lets the library reach back into your app for things like the logger you want to use, a Gson instance for JSON, a coroutine scope, a health monitoring config, and a network monitoring config. This means the library does not force a particular logging or serialization choice on the host app. All MQTT actions go through a command submission model rather than direct method calls. There are ConnectCommand, PublishCommand, SubscribeCommand, UnsubscribeCommand, and DisconnectCommand types, each submitted with pulseMqttKit.submitCommand. Commands can declare dependencies on other commands, so for example you can attach a ConnectCommand as a dependency of a SubscribeCommand and the subscribe will only run if the connect succeeds first. Each command also takes a retry policy: Sequential for fixed intervals, Exponential for back-off, Jitter for adding randomness so many clients do not retry at the exact same moment, or None to disable retries. You can exclude specific MQTT exception codes, like NOT_AUTHORIZED, from retry attempts. The connection options can include an AutoSubscriptionConfig with a map of topics and the message types and quality of service levels you expect on each. When this is enabled, the library re-subscribes to those topics on its own after a reconnect, so you do not have to resend SubscribeCommands yourself. You can also register listeners that receive results for each command, including how many retry attempts were used and the total execution time, and unregister them when done. For staying connected over time, the library has a health monitoring system that can run periodic checks through either Android's AlarmManager or Jetpack WorkManager and reconnect automatically if the link drops. A shutDown call disconnects and clears all listeners. The README is published as plain documentation with example code; no license is shown in the clipped portion.

Copy-paste prompts

Prompt 1
Show me how to initialize PulseMqttKit in my Android Application class and implement the bridge interface.
Prompt 2
How do I submit a ConnectCommand with exponential backoff retry and then chain a SubscribeCommand to run only after successful connection?
Prompt 3
Set up auto-subscriptions so my app re-subscribes to topics automatically after a network reconnect without manual intervention.
Prompt 4
How do I register a listener to track command execution time and retry attempts, and what does the callback receive?
Prompt 5
Configure health monitoring using Jetpack WorkManager to detect dropped connections and reconnect automatically.
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.