Hi,
I’m developing an android app to show location information on google maps, I want to save the maps and data that user visits using Couchbase Lite on user device so that the app works faster and also could be used offline.
Is that possible and how should I configure SGW and Couchbase Lite to do that?
Yes, Thats a typical use case of Couchbase Mobile - to sync data and cache it locally for offline use . Not sure of the format of your map data but you can add attachments (v1.x) and blobs (v2.0)
I would recommend that you review the guides on our portal on how to get going with integrating Couchbase Lite into you r Android app , configure your SGW and Couchbase Server (You didn’t mention Couchbase Server - but thats the third component of the Couchbase Mobile stack that persists the data in the cloud). Post any specific questions that you may have here.
thank you, I played with Couchbase Server, SGW and Couchbase lite a little bit and it seems that it syncs all the data, of course I don’t want to copy (sync) all the Server data to user device,
so how can i detect user visited data and just sync that data?
What version of Couchbase Mobile are you using ? And how did the documents get to the server (were they synced up from mobile apps, through the server SDK or the SGW REST API?)
At a high level, you can use the sync function
to specify how documents get routed using channels . You also specify the access control to the channels. The client side can then replicate documents assigned to specific channels.
I’m using SGW 1.5 and couchbase lite on android and sync data from mobile app, I used this example.