简体   繁体   中英

Web Api mongodb and android

I want to create a project in ASP.net with webAPI and Mongodb. client are IOS, Android, and Web. the question is about at client side when he/she is offline (no internet), they store data in Mobile (locally in android or pc or ios device) after come online (connect with server) the new data will be Sync. please guide me with MongoDB

Create a Service for when the user was online, then download the messages/or syncs with MongoDB on ServerSide .

Of course, you can save these things with Sqlite on Android.

That is exactly will works like WhatsApp

Use Broadcast Listener to listen for Internet Connectivity... Keep your data stored on SQLite, and upload them once you get in internet connectivity.

You can know more about BroadcastListener from this link... http://developer.android.com/reference/android/content/BroadcastReceiver.html

and you can also see this about how to listen for Internet Connectivity Broadcast receiver for checking internet connection in android app

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM