I need to have connection with server in my app in such a way that whenever there is data update happens in server I need to get that change reflected in app as well, like how firebase real time DB works. Is it possible to do it without fetching whole data everytime? Please help.
Asked
Active
Viewed 224 times
1 Answers
0
You can pass the timestamp of the last request and response only data that is older than the passed timestamp
# client
https://url.com/?my_timestamp=1234
#server
select data where data.timestamp > my_timestamp

MikhailM
- 71
- 5
-
for this to happen app needs to hit server right? so while user is using the app and something changed in server DB. so how will i get that update? When we use firebase realtime DB that happens actually. – Droid Nov 24 '21 at 10:28
-
Firebase uses some telephony dark magic. There is no simple solution I am aware of except for [using a sockets](https://stackoverflow.com/questions/7384678/how-to-create-socket-connection-in-android/7384830). – MikhailM Nov 24 '21 at 10:33