mongodb stitch sync on android

34 views
Skip to first unread message

Tod Felix

unread,
Mar 26, 2019, 7:09:11 PM3/26/19
to MongoDB Stitch Users
Hi,
I am very new to mongodb so I began to read the docs and followed the tutorials on https://docs.mongodb.com/stitch/.
My problem now is that I need to create an android application which works either with internet on not. So I tried to run the Todo example, but launch the app while the wifi connection is off I can't log in as anonymous.
Isn't Sync supposed to work even offline? Or how can I use MongoDB Mobile to make it send the data when internet is available?

Thank you
Tod

Adam Chelminski

unread,
Apr 2, 2019, 6:30:08 PM4/2/19
to MongoDB Stitch Users
Hi Tod,

Thanks for reaching out.

MongoDB Mobile Sync can be used offline, but right now, it's only possible to interact with the local offline version of the collection if you are logged in as a user. To log into a user, you need to have been online at one point. Once you are logged in, you can go offline and interact with the local database whether you are offline or online.

If you need to interact with the database when you are offline and signed out, you can currently only do that with the local MongoDB service, which lets you interact with a local collection in an offline-only way. You can store documents in this local collection, and you can write code to move these documents over to your mobile sync collection when you are signed in.

Would this fit your use case? Let us know if you have any further questions.

Thanks,
Adam

Tod Felix

unread,
Apr 21, 2019, 12:07:26 AM4/21/19
to MongoDB Stitch Users
Hi Adam,

Thank you for your reply. 

That's actually what I figured out after doing some tests.

Cordially,
Tod
Reply all
Reply to author
Forward
0 new messages