1. Compile the MQTT client rack package
I chose Eclipse Paho Java
Download the source code at http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.java.git/
Import into eclipse, call maven install to compile 2 rack packages:
org.eclipse.paho.android.service-1.0.2.jar
org.eclipse.paho.client.mqttv3-1.0.2.jar
2. android client
Copy the two previously compiled packages to the android sample in the source code, so that the sample can run
3. Server
I chose moquette
https://github.com/andsel/moquette
After downloading and decompressing, you can run it directly, listening on port 1883