Giter Site home page Giter Site logo

ghaithdallaali / solace-kotlin-android-paho-example Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 10.0 1.28 MB

A simple hello-world Android application written in Kotlin that uses Solace as a message broker.

Home Page: https://solace.com/blog/event-driven-kotlin-android-app-mqtt-solace-pubsub/

License: MIT License

Kotlin 100.00%
solace kotlin android-application message-broker

solace-kotlin-android-paho-example's Introduction

solace-kotlin-android-paho-example

A hello-world Android application written in Kotlin that uses Solace as an MQTT pub/sub message broker

Creating a Solace Cloud Service

  • Follow the "Get Started" steps here to create a Solace Cloud account if you don't already have one
  • Create a free Messaging Servie in a cloud provider and region of your choosing
  • Once the Messaging Service is up, navigate to its "Connect" tab and find its MQTT Connection Details. These details will be used to connect your application(s) to the Solace PubSub+ Message broker

Alt text

Running the app

  • Import the project into Android Studio after cloning it.
  • Navigate to app/src/main/java/com/example/myapplication/MessagingOptions.kt and update the following constants based on your broker's connection details:
    • SOLACE_MQTT_HOST
    • SOLACE_CLIENT_PASSWORD
  • Modify the TOPIC to publish/subscribe to, as well as the MSG payload under MainActivity.kt
  • Build and run the sample app
    • The app has three input fields: the topic to subscribe to, the topic to publish to, and the message payload to publish. If subscribed to a topic, you may publish to the same topic a message of your choosing. By doing that, the application is publishing the message with said message payload/content to the Solace PubSub+ Broker. The broker would then send that message to its subscribers (the app itself), and a callback on the app would be triggered to update its "Received Message Payloads" Alt text

solace-kotlin-android-paho-example's People

Contributors

ghaithdallaali avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

solace-kotlin-android-paho-example's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.