1. XML + HTTP
This communication method is widely used in the instant messaging protocol XMPP and other RSS resources such as podcast;
The advantage of this method is that the server business and interface design will be clearer and simpler;
2. JSON + HTTP
One of the most popular and common ways to interact with servers on mobile phones;
The advantage of this method is that it saves more traffic than the first method, but the interface design and parameter transmission are comparatively more troublesome;
3. Protocol buffer + HTTP
Protocol buffer is a cross-language binary transfer protocol of Google;
This method is obviously efficient, but it will introduce external libraries to increase the package size of the android client. It is not especially performance-demanding and generally not used;
4. TCP
This Protocol is often used when we transmit a variety of large files, or where the performance and traffic requirements are high;
5. UDP
As a heartbeat packet transmission protocol, it is the best option (for example, when pushing data to Alibaba Cloud)