SMQ Java and Android Stack
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Java and Android SMQ Client Library and Example

SMQ, based on the publish - subscribe pattern, provides features similar to other pub/sub protocols such as MQTT. However, SMQ extends the pub/sub pattern with additional features such as one-to-one messaging and sender's address, features typically required in device management.

The Java SMQ client library is designed for standard Java and Android.

Note that the SMQ protocol supports both non secure and secure (TLS) connections, however, the Java SMQ client library is designed to operate only over a secure TLS connection. The TLS connection used by Java SMQ is managed by the Java platform's TLS functionality.

Java SMQ DZone Article

Java SMQ Example

Compiling the Included Java Swing Example

This example is designed for Swing and. An Android example is also provided (see below).

You may include the SMQ Java code in your Java build, but do not include the file RTL/SMQ/ since this file is designed for Android.

You may compile and run the SMQ LED example on the command line as follows:

java LedSMQ

The Swing example connects to the public SMQ test broker. You may control any of the connected devices, or you can run a simulated device by using the online device C example. Note that the Swing example also opens a browser window and redirects the browser to the LED example's HTML5 UI. This makes it easy for you to see how the Swing UI example can be synchronized in real time with the HTML5 UI example.

See the SMQ LED example's tutorial for more information on how this example works.

Compiling for Android

You may include the SMQ java code in your Android build, but do not include the file RTL/SMQ/ since this file is designed for Swing.

A ready-to-use Android example can be downloaded from the SMQ source code home page . A pre compiled example is available on Google Play.

SMQ Library Source Code

The SMQ Java library can be found in RTL/SMQ. Depending on what environment you are building for, delete RTL/SMQ/ or RTL/SMQ/

Example Source Code

  • the Swing LED example.
  • org/json: the JSON library used by
  • eu/hansolo/steelseries: provides LED UI for

Note: the Java SMQ library is not using any of the above and you should only include RTL/SMQ in your own build.


The source code is released under the Eclipse Public License - V 2.0:

You may compile a Program licensed under the EPL without modification and commercially license the result in accordance with the terms of the EPL.

This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public License, version 2.