tokudu / androidpushnotificationsdemo Goto Github PK
View Code? Open in Web Editor NEWA example of an android app that receives push notifications using MQTT.
Home Page: http://tokudu.com/2010/how-to-implement-push-notifications-for-android
A example of an android app that receives push notifications using MQTT.
Home Page: http://tokudu.com/2010/how-to-implement-push-notifications-for-android
In keepAlive() function in PushService line 292, as we can see: if "mConnection.sendKeepAlive();" this line throws a MqttException Exception and catched by the exception block, we will cancle both KEEP_ALIVE alarm and RECONNECT alarm.Thus we will lose connection with the server forever! And will not reconnect at some point in the future. What I'm worried is the CLIENT will completely lose connection with the SERVER forever? Am I right and how to figure out the problem?
Hi,
I want to subscribe from topic. How can I subscribe from topic ?
Best Regards,
I used wmqtt.jar in my android app,but it throws noclassdef found javax.micoredition.io.Connector.
Did you encounter that problem?How to deal with that?
sorry,I solve that.
I used the wrong jar that used for j2me.
Hi Anton,
Thanks for such a simple example for android MQTT client.Having said that I would request you to kindly let us know about the licencing of the project as it is not mentioned in the project directory.
Thanks and Regards
Ashish Vyas
12-05 13:02:04.201: ERROR/com.app.service.PushService(5696): MqttException
com.ibm.mqtt.MqttException
at com.ibm.mqtt.MqttBaseClient.doConnect(Unknown Source)
at com.ibm.mqtt.MqttBaseClient.connect(Unknown Source)
at com.ibm.mqtt.MqttClient.connect(Unknown Source)
at com.ibm.mqtt.MqttClient.connect(Unknown Source)
at com.app.service.PushService$MQTTConnection.<init>(PushService.java:446)
at com.app.service.PushService.connect(PushService.java:284)
at com.app.service.PushService.reconnectIfNecessary(PushService.java:378)
at com.app.service.PushService.onStartCommand(PushService.java:191)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2490)
at android.app.ActivityThread.access$1900(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.os.NetworkOnMainThreadException
at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)
at java.net.InetAddress.lookupHostByName(InetAddress.java:385)
at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
at java.net.InetAddress.getByName(InetAddress.java:289)
at java.net.InetSocketAddress.<init>(InetSocketAddress.java:105)
at java.net.InetSocketAddress.<init>(InetSocketAddress.java:90)
at com.ibm.mqtt.j2se.MqttJava14NetSocket.<init>(Unknown Source)
at com.ibm.mqtt.j2se.MqttJavaNetSocket.setConnection(Unknown Source)
at com.ibm.mqtt.Mqtt.tcpipConnect(Unknown Source)
Seems to happen on JB+ now.
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.