Recently in a project to use the message push, after searching the internet for a while to find IBM's two MQTT libraries, respectively, Wmqtt.jar and Mqttv3.jar. This article is mainly for the use of Mqttva.jar library to explain.
The first choice is to build the ACTIVEMQ server. ACTIVEMQ Server installation and dynamic line can be online Baidu or other engine search, the introduction is very complete.
First, use ADT to establish the following works
The above is I set up the project, of course, the code is also a part of the network, and now back to the network, haha ~ ~ ~
Second, Android interface design
Can be designed as on the interface, this is entirely by the guys themselves how to get.
Third, PostScript
After the project code has been written, run on a phone or a mold, enter an address, port, subject, and so on, you can begin to subscribe and publish the MQTT message.
Last attached code: http://download.csdn.net/detail/liuping36131997/8147273
Implementation of Android based on MQTT protocol