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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With