igenius-srl / android-mqtt-service Goto Github PK
View Code? Open in Web Editor NEWMQTT service for Android
License: Apache License 2.0
MQTT service for Android
License: Apache License 2.0
It would be nice to allow "unclean" sessions. This is useful for e.g. push services where the client should receive pushes that were send while the client had connection problems.
I think the change has to be done here (and upwards to make in configurable)
Due to new Android O background policies, the service no longer works properly on API 26.
Linked to: eclipse/paho.mqtt.android#195
Hello
Thanks for this amazing wrapper over MQTT.
I need to transmit image data in byte[] format over using MQTT. Your library does only support for data in text format.
I can convert the byte[] in Base64 and then decode it at receivers end, but it's require additional computation and sometime I'm getting weird size limit exception too. As per my knowledge MQTT itself transport data in byte[] format.
I modified you library and made some changes to make it work with byte[] data but for that I've almost destroyed you architecture. So I guess you are the best person to make this change.
Can you please add support for byte[] format data publish/receive.
Thanks
MQTT error. RequestId: .mqtt.connect-and-subscribe/ce01d296-2595-4b6c-9a8f-967a0cfec653
MqttException (0) - java.lang.NullPointerException: Attempt to invoke virtual method 'void java.util.Timer.cancel()' on a null object reference
at net.igenius.mqttservice.MQTTService.onConnect(MQTTService.java:172)
at net.igenius.mqttservice.MQTTService.run(MQTTService.java:112)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.util.Timer.cancel()' on a null object reference
at org.eclipse.paho.client.mqttv3.MqttAsyncClient.stopReconnectCycle(MqttAsyncClient.java:1120)
at org.eclipse.paho.client.mqttv3.MqttAsyncClient.reconnect(MqttAsyncClient.java:1057)
at org.eclipse.paho.client.mqttv3.MqttClient.reconnect(MqttClient.java:524)
at net.igenius.mqttservice.MQTTService.reconnect(MQTTService.java:186)
at net.igenius.mqttservice.MQTTService.onConnect(MQTTService.java:166)
at net.igenius.mqttservice.MQTTService.run(MQTTService.java:112)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
Hello there,
i followed the readme, and the code from example, i keep getting the following error on app launch;
E/Receiver: .mqtt.connect-and-subscribe/500c1759-571c-4eba-aa3b-c77390439a5d exception
_2 how do i specify will topic, and will message?
_3 dose it support non ssl?
_4 dose it support websockets?
Thank you.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.eclipse.paho.client.mqttv3.MqttAsyncClient$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.eclipse.paho.client.mqttv3.MqttAsyncClient$2) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.eclipse.paho.client.mqttv3.internal.ClientComms$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.eclipse.paho.client.mqttv3.internal.websocket.WebSocketNetworkModule$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.eclipse.paho.client.mqttv3.internal.websocket.WebSocketSecureNetworkModule$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.eclipse.paho.client.mqttv3.persist.MqttDefaultFilePersistence$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.eclipse.paho.client.mqttv3.persist.MqttDefaultFilePersistence$2) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
Solution from eclipse/paho.mqtt.java#213
Hello, I have been using this code to publish messages:
public void publishMessage(String topic, String message) {
final int qos = 2;
byte[] encodedPayload = new byte[0];
try {
encodedPayload = message.getBytes("UTF-8");
MQTTServiceCommand.publish(getActivity(), topic, encodedPayload, qos);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
Nonetheless, when I receive messages with MQTTlens, the qos is still 0 for the sent messages. Is this a problem of the service?
Simple question.
A bit confused :)
For what purpose does the client provide the username and password?
Does the client sign up at first login?
Who provides the username and password?
Or should I randomly generate 2 strings as the username and password for each client?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.