JBoss push notification to Android - java

I have a java application under JBoss and i want to send push notifications to notify the Android device if i needs some particular piece of data, and then the device can send that to the server.
I found two solutions:
- Android Cloud to Device Messaging (C2DM)
- MQTT
I'm new to these message protocols and i'm searching if there is compatibility with JBoss. In particular, for the MQTT, i can't find a MQTT broker for JBoss.
Can anyone help me or suggest me other solution for pushing notifications to Android devices?
Thank you

C2DM has been deprecated by Google. The current version of the Google Push Service is called Google Cloud Messaging.
On your MQTT broker question: You need an MQTT client on Android and you can use any MQTT broker you like for the server part (for example HiveMQ [1]). The Android client subscribes to the broker and your JBoss application is another client, which simple publishes a message that the client receives. For that to happen your MQTT broker needs to be accessible from Android and the JBoss application, and both need to use the same topic.
As client library for both you can use Eclipse Paho [2] and for testing a public mqtt broker [3].
Hope that helps,
Chris
[1] http://www.hivemq.com
[2] http://www.eclipse.org/paho/
[3] http://mqttdashboard.com/dashboard

You can use openmobster (Open source Mbaas)
This Provides a mobile platform-independent Cloud-initiated Push Notification System.( In Android, the push mechanism is based an a persistent socket connection)

Related

Can I send message from different device ID with the same connection to IOT Hub?

I'm new using IOT Hub from Azure and I am writing a connector which listen to an enterprise MQTT broker and send them back to an IOT Hub server. The problem I'm facing is that I need to create a connection per devices... Is there a way to avoid that ?
Either by using the IOT Hub client SDK or any MQTT library (like paho)
It's not an option to program all the devices to connect directly to the IOT Hub.
The azure iot java sdk supports connection sharing. Go to the samples section of the sdk (https://github.com/azure/azure-iot-sdk-java/device/iot-device-samples and take a look at the transportclient-samples.
For MQTT supported on Azure IoT Hub, there is only one active connection of one registered device Id at the same time.
For connection multiplexing across devices, you can select AMQP protocol.
More detailed information about MQTT supported and choosing a protocol you can reference:
Communicate with your IoT hub using the MQTT protocol
choose a communication protocol

Java Client for MQTT using AWS IoT

I am fairly new to the Aws IoT . I am aware that we can write the Java client for Aws IoT. I have below three queries:
Is the Java Client used only to receive messages from the 'Thing' on Aws ?
Can other devices subscribe to the Java Client
Can this client also send messages to other devices
It will be helpful if you could help out with the starting point to implement the Java. References to any articles or links would really helpful.
Is the Java Client used only to receive messages from the 'Thing' on Aws ?
Let's assume under the Java client we will understand the MQTT client. MQTT is a messaging protocol (most commonly used with AWS IoT - at least what I've seen). And you can consider the AWS IoT as a messaging hub.
So your client can subscribe for messages from things or queues to receive messages, but as well your client could send messages to the topics or things (topics reserved for things). All things or devices are effectively messaging clients for the IoT hub.
Can other devices subscribe to the Java Client
I don't full understand your question. So I'll be guessing that your question is about other clients or devices could receive messages from your application? (a device is just another client).
The clients can subsribe to their tpoic (representing a device or functionality). Your application can send a message (see point 1) to a topic for any device it wants.
Can this client also send messages to other devices
sending messages to other devices means sending messages to topics, to which the other devices are subscribed
help out with the starting point to implement the Java
You may check the Eclipse Paho project (MQTT client)

Actor Gateway for Kaa Server - Java based

I am using KAA iOT server to connect my hardware with cloud. I have implemeted MQTT protocol in hardware and need to implement Actor Gateway or some other solution to enable communication between hardware and cloud. I am unable to find any guide on how to implement actor gateway. Any help please.
Currently KAA only support HTTP/HTTPS, it does not support MQTT protocol. Actor gateway(Like Raspberry Pi, Cloudgate etc) will have the Kaa's SDK which will be bundled with application running on Actor gateway. The application running on Actor gateway should MQTT implementation. Your device will talk to Actor gateway with MQTT protocol. You have to design your system in that fashion.
Below diagram will show you the Actor Gateway approach:

Android application connected to an ActiveMQ server

I wanted to know if it is possible to create an Android Application that sends and receives messages through the ActiveMQ server? if its been done can you show me some examples perhaps?
Thank you for taking the time to read
you can use Stomp Java lib to consume from queues https://github.com/fusesource/stompjms
here an example of android app that talk to activemq https://github.com/jsherman1/android-mqtt-demo
https://dzone.com/articles/android-mqtt-activemq
http://activemq.apache.org/mqtt.html
ActiveMQ supports the MQTT protocol and will automatically map between
JMS/NMS and MQTT clients. MQTT is a machine-to-machine (M2M)
publish/subscribe messaging transport.

Is there a Java API for GCM Cloud Connection Server

I am just going through the new features of GCM Cloud connection server. On client side this seems fairly easy using the google play services, as described in https://developer.android.com/google/gcm/ccs.html, however for the server side it says:
GCM Cloud Connection Server (CCS) is an XMPP endpoint, running on
http://gcm.googleapis.com port 5235.
CCS requires a Transport Layer Security (TLS) connection. That means
the XMPP client must initiate a TLS connection. For example in smack,
you would call setSocketFactory(SSLSocketFactory), similar to “old
style SSL” XMPP connections and https.
CCS requires a SASL PLAIN authentication mechanism using
#gcm.googleapis.com (GCM sender ID) and the API
key as the password, where the sender ID and API key are the same as
described in Getting Started.
Does that mean I manually have to open a port and parse xml/json or is there some kind of Java API that I can use to implement the server side?
For the GCM Server there is a library, the javadoc is at http://developer.android.com/reference/com/google/android/gcm/server/package-summary.html
There is a demo server app Google has written here at http://developer.android.com/google/gcm/server.html
As I understand you can choose whether you want to use the XMPP service or the old HTTP service. Not sure what the advantage is.
You can use Smack library to work with XMPP in Java.
And here you can find an example code that sends notifications using GCM CCS.

Categories