I make an application on android, which interacts with the server through sockets. The server can receive various types of data and in response can send various types of data. How to organize interaction? Now I transfer the List<Objects> , in which the first element is the client id, the second is the operation identifier, and further I add the necessary data (always primitives). On the server side, cast to the right types. I cannot pass an object being serializable, because the package names are different. How to do?
|
REST-APIof the data exchange protocols, I don’t think it’s worthwhile to invent something of your own, except to “play”. Usually, the data is transferred tohttp,httpsinjsonformat - Igor Lavrynenko