I'm new to Android and and made an application which fetched and post data to server and works fine in online mode. But I want to make it works in offline mode also, when there is no internet connection or network failure. It should also make changes (updates) to the server database when net is available. I have done lots of R & D but didn't get the useful info.
Please someone guide me with some useful steps, sample code (if possible) or any link to make app in offline mode.
What you are asking is actually incredibly complicated.
I have spent a good year of my own time trying to solve this problem and have published my work in the SyncIt project which is at http://forbesmyester.github.io/SyncIt/ .
There is:
I suggest that you start reading about the local version control component and then move onto the connection monitoring component.
Use SQLite database. Save data in database when there is no internet. Then sync data with server when internet comes back.
http://www.androidhive.info/2011/11/android-sqlite-database-tutorial/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With