Send data from server to Android app

What is the best way to send data to an Android device from a server from an Android application? My current setup:

Postgresql database -> program running on the server machine -> Android device.

I am currently using my own protocol, but in the end I would like my data source to be accessible to the application development community as a whole. Thus, I would like to know the best and simplest options with which I can serve this data.

+4
source share
3 answers

I read that you need it right now. I have 2 suggestions for you.

  • HTTP Pooling . so that the mobile application gets to the server with a certain frequency, say, 2 minutes in response to the hit, the server can send information about the desire to the mobile device. This mainly depends on how often you expect the server to contact the mobile application.

  • [RECOMMENDED] Use TCP mode to communicate between the mobile and the server. I recommend this because in a TCP connection, the server can push message to the mobile application without the mobile application continuing to attack the server.

+5
source

You need to look in Android Cloud To Device Messaging. Here's a great post from the official developer blog: http://android-developers.blogspot.com/2010/05/android-cloud-to-device-messaging.html

+2
source

Use Google Cloud Messaging for Android: http://developer.android.com/google/gcm/index.html

+2
source

Source: https://habr.com/ru/post/1343506/


All Articles