Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Dropbox Datastore API as a primary storage option for Android application

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?

like image 630
esteewhy Avatar asked Oct 21 '22 05:10

esteewhy


1 Answers

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.

like image 180
Andrew Avatar answered Jan 02 '23 19:01

Andrew