In this post, I am going to explain how to sync data present in remote MySQL DB to Android SQLite database. The data present in the remote MySQL DB (or any Database) needs to be synced with SQLite DB in Android in order to maintain the data integrity.
If there is change in remote DB data, it can be synced with Android SQLite DB when User explicitly hits ‘Sync’ button or asynchronously by the application itself (in particular interval) when Internet connectivity is available.
In this post, I am going to explain how to sync data present in Android SQLite database to remote MySQL DB. In most of the Android applications, the data present in the local SQLite database will be synced with remote DB in order to perform statistical operations at the server end, maintain backup of the offline data etc.
In such cases, offline data will be synced with remote DB when User explicitly hits ‘Sync’ button or asynchronously by the application itself (in particular interval) when Internet connectivity is available.
I hope you folks understood how easy it is to develop Android application with AQuery library in handling image loading, making asynchronous call and lot more from my previous posts. If not take a look at the below posts and they are prerequisite to develop the Application which I am going to teach you in this post.
It’s time to explore the other most wonderful feature of AQuery and that is ‘Asynchronous Network Calls’ to download JSON from remote server. In this post we will be developing simple application to demonstrate how to download JSON from Internet and render it over UI after parsing it. I already wrote a separate article – Android JSON Web Service Tutorial on how to make Asynchronous call to download JSON from Network using Android Dot Net Webservice combo.
In this post we will be discussing on how to consume JSON response (returned on invoking web service) in Android applications. I took simple example to demonstrate the JSON Web service tutorial. The example which we are gonna create will have two spinner controls (called Dropdownlist in traditional desktop applications), one to display ‘Countries’ list and other to display ‘Cities’ list.
When user selects a country from the ‘Countries’ spinner control, cities belong to the selected country will be populated in the ‘Cities’ spinner control.