I'm looking for a way to sync SQLite data of my Android app across devices.

Dropbox Datastore API seems to fit just fine (at least conceptually). I've studied available examples, but cannot yet understand how does this API fit into Android data access worldview with it's ContentProvider=>ContentResolver=>Adaptor=>ListView machinery.

My guess is that certain plumbing is required for smoother integration of Datastore API, maybe even as a drop-in replacement of SQLite. And the best place where it belongs seems to be close to ContentProvider.

Is the above assumption correct, i.e.: should i try to write my custom ContentProvider that will take it's data from Datastore API? Or maybe better options exist/planned?

有帮助吗?

解决方案

There isn't (yet) an existing infrastructure/library for directly connecting Dropbox Datastores to SQLite or Android Content Providers. But conceptually, I think you have the right layering in mind. A Datastore provides a similar sort of functionality to SQLite, so you can fit it into your application at the same layer. A ContentProvider built on top of a Dropbox Datastore would be a good way to abstract away the details and fit in with a lot of existing Android functionality. It should be relatively straightforward to adapt for simple queries.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top