I am designing an android ERP apication with a WEB API backend which has a shared database for all users. I want to have offline synchronization of data so that the application is responsive even if the user is not in an active network. I have read about syncadapters in android and I am trying to find out the approaches and best practice to achieve this. Without the offline stuff I was just calling the Web Api to get the view models back in JSON and displaying them. The approach I am considering now is -
Have an almost similar database schema in android as the shared web api has. Write almost all the business logic in android and do all the operations locally. While synchronization find out that the database has been changed and then replay all the actions that have taken place in the same order in the web api too. But I would need to write the business logic in both places letting me think it is not a good approach. What is the best practice for writing such an app given that these are fairly common.
Aucun commentaire:
Enregistrer un commentaire