jeudi 29 janvier 2015

How to handle GET request in Content-provider centric design pattern for android

I am developing an android calendar app which will enable users to view, create, update and delete their events. To improve user experience and performance i have adopted a Content-provider centric design pattern which was recommended during Google IO 2010 conference on Android client application. I have successfully implemented the client rest service that create, update and delete events parsed from the content provider to a Restful web service written in PHP but i need some ideas on how to implement the get request in order to prevent data conflict and maintain accurate persistence on the client side. The restful web service returns a JSON payload of all the event based on a user's id, so i want to store these record in my content-provider with not conflict (is more like a sync). For instance, if a user re-installs his app, how do i ensure that the data already stored on the server is persistent which the application's content provider (which has a local SQLite database). A more basic explanation is populating the content-provider with non-duplicate events after the application is re-installed or an event is added directly to the server. Thanks in advances.


Aucun commentaire:

Enregistrer un commentaire