Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paho MQTT Android service wake up activity

I am trying to use Paho Android MQTT library (downloaded from here). The sample service application works fine, the subscribe and the publish methods work fine too when the sample application is running. When I close it, the device doesn't receive message notifications anymore.

Does anyone has an experience how to modify/implement the service correctly to receive message even if the application isn't running?

like image 248
wyzard Avatar asked Jan 25 '15 21:01

wyzard


1 Answers

As far as I understand the topic Paho brings all you need. In my application the paho mqtt-service never stops until I want it. I registered the Paho-service in the manifest to Android with the following snippet.

‹!-- Mqtt Service --›
‹service android:name="com.ibm.android.service.MqttService" /›

This should do the trick.

More information in the description of http://www.eclipse.org/paho/files/android-javadoc/index.html

like image 119
kdoteu Avatar answered Oct 29 '22 06:10

kdoteu