I am developing an android application, It has a server side too. In server side i am using mysql and php. I want to sync the data between mysql and sqlite.
How to do this ?
Method #1 : Using Sync Adapter
You can sync the device and a server using a Sync Adapter in android. See the developer documents.
Basically this requires you to extend your class with AbstractThreadedSyncAdapter where you write your sync logic, create some xml files and a Content Provider to share your data.
With this method you dont have to handle network availability. All the work is basically done by android.
This is an android sample I wrote using AbstractThreadedSyncAdapter to sync data between device and a server. This is its server side written in Java using Servlet. Please have a look.
Method #2 : Using a simple API
If you don't need all that complexity, you can just create an API that both accepts the data from the device and outputs the data on the MySQL database. You will need to write some logic to sync the data.
Good luck :)