1

I have the following architecture:

There is my backend (spring boot), with can receive data from my client (android device) over a REST api and it also provide data over the REST api.

The data which are provided, change from time to time, without a dependency from the data the client send.

Is it now possible in android to write a callback for the data which the backend provided?

You could do it with a button, but I want to get the new data automatically when ever they change. How would you do it, with a timer/interval?

For example I know Firebase (from Google), where you can do something like this, there you can define a callback and get the new data when ever they change...something like this is what I want.

2 Answers2

1

This is a typical PUSH scenario, in which your app must be notified when data changes in server side.There are different approaches:

I would recommend you to use FCM to implement this scenario, without degrading performance or wasting battery life by polling the server.

Community
  • 1
  • 1
Álvaro Pérez Soria
  • 1,443
  • 1
  • 13
  • 26
0

You could probably do it with WebSockets but there isn't an out-of-the-box solution like with Firebase, no.

Miloš Milivojević
  • 5,219
  • 3
  • 26
  • 39