Improved Application to Server Communication

Asked

Viewed 1,453 times

2

I am developing an application that needs to communicate with the server (send and receive data). What would be the best way to make this data exchange safely and performance? Through REST/WEB SERVICE, Sockets, HTTP request or some more specific?

Note: I’m surprised the way Whatsapp receives information, instantaneously and slowly, this would be an example of Sockets?

I await your suggestion.

1 answer

0

To connect to the server, Voce can use Volley and the OKHTTP library. To make simple requests you can see in the post HERE

In the case of Whatsapp that Voce spoke would risk saying that on their server they have a Google Cloud Messaging (GCM) implementation. GCM works so that whenever the user installs and runs the application for the first time, registers to the google server and the server returns a key that will identify the application on that device, then the app sends that key to the server(in this case that of Whatsapp) and keeps in the bank associated with the logged in user. Whenever another user decides to send a message to this user, it goes to the table that has the key record associated with the user and this same server sends a message to the GCM with the key and the message and google does the information Deliver as soon as the user or app is available.

More on the subject see the link HERE

Browser other questions tagged

You are not signed in. Login or sign up in order to post.