How to listen to real-time updates on android

247 views Asked by At

I reviewed documentation about receive updates of getstream but only way is using javascript client. https://getstream.io/docs/#realtime

Is there any way for implementing real-time update on android?

1

There are 1 answers

1
iandouglas On

There are a lot of Android libraries for websockets, but several considerations to keep in mind if you choose to develop this in your app:

  • keeping a data connection open to Stream will use a lot more data on mobile plans
  • open data connections will keep wifi/cell radios engaged, draining more battery
  • each websocket connection can only watch a single feed -- if you have multiple feeds to watch then you'll use up more connections per mobile client
  • you have a limited number of websocket connections for real-time notifications (free plans only get 250 connections, for example)

We typically recommend having a back-end system that watches all of these feeds periodically, and doing a push notification to the mobile client instead of using the websocket connections. This gives you a lot more flexibility on how often to watch for changes and minimize your users' data and battery consumption.

Our SDKs, which would be part of your back-end application anyway, would generate the token for the client. You can check our SDKs' README files for examples, such as https://github.com/GetStream/stream-python (search for read-only token on the page).