cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle delta (delete) in Android

former_member623332
Discoverer
0 Kudos

Hi,

We are building a native Android application using SCP 2.0 sdk with backend delta implementation.

The delta for creating and updating of records are working correctly and we can see the data updated in the offline store. We want to know how to handle delta delete records that are sent by the backend using the <DELETED_ENTITIES> or tombstones. I am not able to find documentation from the Android SCP 2.0 SDK which talks about handling deleted items.

Please provide inputs on this.

Thanks,

Amit

Accepted Solutions (1)

Accepted Solutions (1)

david_brandow
Contributor

If you are using Offline OData, then those tombstones will be handled automatically.

When you issued the first GET requests, by supplying defining requests and opening the store, the responses from those GET requests will include the entities and a delta token. Offline OData will use the data to populate its local data store and will remember the delta token. The next time you issue a download, it will re-issue those GET requests, adding in the delta token it remembered from the last time. The backend will then respond by sending back only the changes, which may include tombstones. If Offline OData sees new or changed entities, it will update its local data store to reflect those additions and changes. If it sees tombstones, it will remove those entities from its local data store.

Answers (0)