Java – what is the best server client communication protocol used in Android and IOS?
We have a server application (implemented in Java) that will provide some data for our mobile application Apps will be created for Android and IOS
The best protocol / library for this purpose? The overhead of the protocol should be as small as possible
thank you.
Edit: it should be a request – > response szenario Data loss is unacceptable The answer may contain a long string of data, so it requires less overhead
The client should request data (specified key and some defined parameters), such as "give all files in my folder x with extension". The server answers with a list
The first idea is to use XMLRPC, but the generated response is too large
Solution
HTTP (s) is the best protocol for most applications The overhead (i.e. header) is very small. The transmission can be gzip compressed and the connection can be protected through SSL In addition, in 99% of cases, ports 80 (HTTP) and 443 (HTTPS) will be opened Other ports are not - for example, some operators block all other ports unless you pay extra
As for implementation, I recommend that restful web services use JSON format JSON is standardized with little overhead. You have a good library that can be processed in any language (see org.json, which is bundled with Android, but can also be downloaded independently as other applications) Also check this question:
> https://stackoverflow.com/questions/338586/a-better-java-json-library