On Wed, Jun 04, 2014 at 08:03:16AM -0700, Traun Leyden wrote: > The "standard" way to structure an app like that in Android seems like > it would be to wrap up Couchbase Lite as a ContentProvider. @mjq -- > didn't you guys do something like that? Do you have any pointers > there?
We haven't (although I've previously talked about experimenting with a CBL SyncAdapter on this list). I agree with you that a ContentProvider is probably the most "Android" way to do this, and also that it would probably be a fair amount of work. There's a pretty big SQLite assumption running through the content provider stuff so you wouldn't get much help from the framework. I imagine translating the SQL-style WHERE-clauses you'll get into view queries would be the worst bit, but if you have a well-defined document schema you should be able to translate the view results into e.g. MatrixCursors without too much difficulty. Can CBL-Android enforce read-only access through the HTTP API? Even if the data isn't sensitive, I imagine you wouldn't want one of the consumer apps changing it out from under everyone. That's another place a ContentProvider would come in handy: implement just the 'query' methods and the data should be isolated. Exposing data as a content provider should also make it easier to consume by 3rd parties, since they wouldn't have to add a CouchDB client to get at it. Seems to me like a pretty big effort tradeoff though! Matt -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/20140604175653.GA367%40mqmb.local. For more options, visit https://groups.google.com/d/optout.
