< Table of Contents

Checklist: Build Android JMS Clients

This checklist provides the steps necessary to enable your Android client to communicate with your JMS-compliant message broker using the Android JMS Client API, available in the Kaazing Enterprise Android Client SDK. To download the SDK, see Setting Up the Gateway and Clients.

# Step Topic or Reference
1 Learn about supported browsers, operating systems, and platform versions. Release Notes
2 Learn to use the Kaazing Android JMS Client API and the supported methods. This topic also includes a walkthrough to show you how to build a simple Android JMS client. Use the Kaazing Android JMS Client API
3 Learn how to authenticate your client by implementing a challenge handler to respond to authentication challenges from the Gateway. Secure Your Java and Android Clients
4 Learn how to gather data on your Android JMS client. Display Logs for the Android JMS Client

This document contains the following sections:


In this how-to, you will learn how to use the Kaazing Android JMS Client API available in the Kaazing Enterprise Android Client SDK to enable your Android application to communicate with your JMS-compliant message broker, such as TIBCO Enterprise Message Service (EMS), Informatica UM, Apache ActiveMQ, and JBoss, using WebSocket and JMS.

Overview of the Kaazing Android JMS Client API

The Kaazing Enterprise Android Client SDK includes an Android JMS Client API that allows Android clients to subscribe and publish messages to their JMS-compliant message broker. With the Android JMS Client API and the Gateway, you can leverage WebSocket in your Android client. Communication between your Android client and the JMS-compliant message broker is performed over WebSocket, as shown in the following figure:

Figure: Enable Communication Between Your Client and the JMS-compliant message broker

About the Kaazing Android JMS Client API

The Kaazing Enterprise Android Client SDK includes an Android JMS Client API to enable you to create JMS-based clients specifically for your Android devices. As an Android developer, you can use this API to publish and subscribe to JMS-based messages between your client and your JMS-compliant message broker.

The Android JMS Client API exposes capabilities similar to the Java Message Service (JMS) API in Java, including the JMS concepts of connection, session, destination, message consumer, and message producer. Refer to the JMS API documentation, located at http://www.oracle.com/technetwork/java/docs-136352.html, for specific information about how to use each of the interfaces.

For a description of the methods currently supported by the Kaazing Enterprise Android Client SDK, see Kaazing Gateway JMS Client API: Supported APIs.

Note: Java Naming and Directory Interface (JNDI) is a Java API for a directory service. The Kaazing Enterprise Android Client SDK does not support JNDI. JNDI is supported in the Java JMS Client API. For more information, see Build Java JMS Clients.

About Android

Android is an operating system used by touchscreen smart phones and tablets. Android clients are developed in the Java programming language using the Android software development kit (SDK). The SDK includes development tools, software libraries, and an Android device emulator.

The officially supported integrated development environment (IDE) for Android development by Google Android Studio.

Take a Look at the Kaazing WebSocket Gateway Android Client Tutorial Application

A JMS Messaging demo is available here: https://github.com/kaazing/java.client.demos.

To see this Android demo in action, perform the following steps:

  1. Download Android Studio with the Android SDK from the official Android Studio website.
  2. Download and extract the Kaazing Android JMS Tutorial project from https://github.com/kaazing/java.client.demos. Once the project is extracted, you can build the JMS tutorial app by following the steps here: https://github.com/kaazing/java.client.tutorials/blob/develop/android/jms/README.md.
  3. Create a new Android Virtual Device to run the app. The minimum Android SDK for the virtual device is API 19: Android 4.4 (KitKat).
  4. In Android Studio, click the Run icon, select the target virtual device, and click OK. The Android emulator launches.
    Figure: Android JMS Client
  5. In the Location field, enter wss://sandbox.kaazing.net/jms.
  6. Click Connect. The messages CONNECTING and then CONNECTED appear. The WebSocket connection to the Gateway and Apache ActiveMQ was successful.
  7. Click Subscribe. The message SUBSCRIBE - /topic/destination appears. You have subscribed to the destination.
  8. Click Send. The following messages appear:
    RECEIVED TextMessage: Hello, message
    SEND TextMessage: Hello, message

    You sent the message Hello, message to the destination and received the same message because you are subscribed to that destination.

  9. Click the Send Binary checkbox and click Send again. The following messages appear:
    SEND BytesMessage: Hello, message
    RECEIVED BytesMessage: 0,14,72,101,108,108,111,44,32,109,101,115,115,97,103,101
  10. Click Disconnect to end the session.

See Also

Android JMS Client API