I am developing an Android application for Android. The application stores data in a SQLite database. I want to implement additional backup / synchronization for application data using the Dropbox datastore API . If the user has linked their Dropbox account, the application data must be stored in the Dropbox cloud and synchronized between all user devices.
My solution initially stores all the application data in a database. When a user has linked their Dropbox account application, all data will be transferred to the data warehouse. After that, the application will work with the data warehouse (since it supports offline caching and performs synchronization in the background). If a user decides to cancel his Dropbox account from the application, all his data will be transferred back to the local SQLite database on the device. I want to create an interface for storing application data and have two implementations: SQLite database and Dropbox data warehouse. Thus, other components of the application will not be dependent on the implementation of the repository. And, of course, all this will be completely transparent to the user.
Is this a good approach? Can you suggest a better way?
Thanks in advance!
source
share