I develop notepad application for Android. App stores it's data in SQLite database. I want to implement optional backup/sync for app data using Dropbox datastore API. If user has linked his Dropbox account app data should be stored in Dropbox cloud and synced between all user's devices.
My solution is initially store all app data in database. When user has linked his Dropbox account application will move all data to datastore. After that app will work with datastore (because it supports offline caching and performes synchronization in background). If user has deciced to unlink his Dropbox account from app all his data will be moved back to local SQLite database on device. I want to create interface to app data storage and have two implementations: SQLite database and Dropbox datastore. So other app components won't be dependent of storage implementation. And of course all these will be completely transparent to user.
Is it a good approach? Can you please suggest the better way?
Thanks in advance!