What is the best server client communication protocol to use in Android and iOS?

后端 未结 3 2565
离开以前
离开以前 2021-02-20 18:30

We have a server application (implemented in Java) that will provide some data for our mobile apps. The apps will be created for Android and iOS.

Which is the best proto

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-20 19:16

    For most applications, HTTP(S) is the best protocol to use. The overhead (i.e. headers) is pretty small, the transfer can be gzipped, the connection can be secured (via SSL). Also, ports 80 (HTTP) and 443 (HTTPS) will be open in 99% of cases. Other ports are not -- for example some carriers block all other ports unless you pay extra.


    As for the implementation, I suggest a RESTful web service using the JSON format. JSON is well standardized, has small overhead and you have good libraries for working with it in any language (check out org.json, which is bundled with Android but can be downloaded as standalone for other applications as well). Check out this question, too:

    • https://stackoverflow.com/questions/338586/a-better-java-json-library

提交回复
热议问题