GithubHelp home page GithubHelp logo

igenius-srl / android-mqtt-service Goto Github PK

View Code? Open in Web Editor NEW
41.0 10.0 24.0 324 KB

MQTT service for Android

License: Apache License 2.0

Java 98.72% Shell 1.28%
mqtt service background android paho mqtt-service

android-mqtt-service's People

Contributors

gotev avatar jomisj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-mqtt-service's Issues

Username/Password Authentification [Question]

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?

Need to publish/receive data as byte[] instead of String.

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

QoS for publishing is not working

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?

Allow reconnect without enforcing a clean session

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)

Paho error on reconnect

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:112at android.os.Handler.handleCallback(Handler.java:751at android.os.Handler.dispatchMessage(Handler.java:95at android.os.Looper.loop(Looper.java:154at android.os.HandlerThread.run(HandlerThread.java:61

Unable to connect.

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.

Ignoring InnerClasses attribute for an anonymous inner class

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

eclipse/paho.mqtt.java@42e2470

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.