Real time update on Android apps

6

Looking at API of instagram and doing searches on the internet I had a big question, how do they synchronize the data in Real Time without saving "photos and videos" in sqlite?

The Instagram documentation says that our app can be notified at every photo update.

But is it possible to develop something like this without using API of them?

Could I use a Observer that every modification triggers a synchronization with my server?

My intention is to create something similar where I have an update in real time.

    
asked by anonymous 30.06.2015 / 02:43

2 answers

3

I think you're looking for the push notifications template to get notifications about what happens in real time in your app or web service in your app and then download more information as needed.

On Android you can use one of the many services available:

Another alternative is to create your own push notifications architecture, one of the most complicated parts is to optimize the server information pooling system so that it does not deplete the cellular resources (battery, memory, data etc), and once received the update notification does the background synchronization with a Service.

    
30.06.2015 / 19:24
1

You can work with the Services concept, which runs requests to the server to check from time to time for something new and update your application or send a notification to the user.

Or work with APIs like Google Cloud Message, among others that can ease your requests and notifications through Push.

Advantages / Disadvantages:

Services - You will have to define it manually, the time to start, time, etc.

Push Notifications You do not have to worry about the time when you start and when you shut down, since it will always be "sleeping", it will only "wake up" when something new on the server.

I hope I have helped!

    
30.06.2015 / 19:47