How to synchronize server data in an Android application?

I am creating an Android application that includes product listing data. These products will be between 500 and 1000 elements and will evolve over time, with changes from the server server.

To avoid collecting large data from the server each time, in order to display the list, it is necessary to save it in the local database and display it by query from the database.

To save data, I studied the following available methods.

  • Embedded sqlite (sync using the sync adapter infrastructure)
  • Kingdom (cannot understand how to synchronize)
  • Couchbase lite (has its own sync gateway)

But still he could not come to any conclusion for the best possible approach.

Since the data is large and we need to have offline data access through the application, data synchronization is becoming very important. I am still learning these things.

Can someone please direct me in the right direction to design data storage and data synchronization with some changes in the backend?

EDIT:


Despite the fact that there are different views or several ways to develop data synchronization in an Android application, you want to understand a few things:

  • Storage Options
    a. Saving to sqlite or NoSQL database like Realm, CouchDB Lite?


  • . sqlite db, , db ?
    b. Realm Sync Realm ?


  • . , API , API? ?

+4
3

, . .

, Google, ( ) .

, , , .

, , push- , , ( 4 , id)

( ) .

https://developers.google.com/cloud-messaging/

. : -

sqlite?

+2

Native sqlite ( Sync). , , , , Sync Adapater . http://developer.android.com/training/sync-adapters/creating-sync-adapter.html .

1) , , , . 2) sqlite. 3) cursorLoader sqlite .

, . .

, , , , 500-1000 , , , , , , , StandBy, , , .

, , , . , .

Ps Adapter pass 0 flags, Loader , init.

, .

.

+1

Source: https://habr.com/ru/post/1614100/


All Articles