Marvin-wtt
Marvin-wtt

Reputation: 489

Fetch live data from server

I need share some data between Android devices live (at least every 5 seconds update). I first had in mind to create an async task in which the one device sends its own data to a server and gets the other data as response. I recently read about firebase or synchronized database so I was wondering which is the best way with keeping performance in mind. I'm not asking for code but for ideas to improve my app. I also need to save the "old" data from each client for a history.

Upvotes: 0

Views: 275

Answers (1)

Amir Dora.
Amir Dora.

Reputation: 2717

There is no need to use AsyncTask

For implementing Firebase operations. Firebase is already optimized. So you don't need to use a background thread for performing network-related operations using firebase.

firebase childevent listener frequently checks for database changes and you can show them on the UI screen, no async task needed.

Upvotes: 1

Related Questions