Question

In our Android App we receive data (AsyncTask, PHP Webservice) from a central database and store this data in a local SQLite database. After this data will be presented to the user in a custom listview. Elements of this datasets are adresses, names, etc. The webservice creates a specific order of this elements by filtering it from the central database.

There could be the case that data, which was already loaded into the app, will be edited in the central database (changing the order, deleting datasets, ...). The app should be synchronous to the central database.

So the question is: What is the best way to compare the existing data in the App with the data existing in the central database? Load the complete data into the App once again and compare it with the existing data in the SQLite-database or send data from the App to the webservice and compare it there? Is there a best practise to do that? The question is not about how to implement that but rather which way to go.

Was it helpful?

Solution

As per my opinion -it totally depends on use-case, where you want to manage the control over data, like from client/device end or server end/central database.

But i would like to add one thing here , the device is powerful resource, use it to Synchronize the data from central to local database and send/delete/update accordingly,

Reason being on server end, one/developer already has to manage the incoming request, querying the database and business logic, why not use the Client's computing power to do some mundane stuff, that's what i think is appropriate.

Others opinion may differ based on scenarios and perspective.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top