1

In my android app I need to sync SQLite database with remote database (mysql) and vice versa....

the concept is something like when application launches application should sync database from remote database.. when I perform some action data should save into sqlite and then sync it to remote database..

Please guide how to perform this task.

Thanks in advance....

Parmendra Singh
  • 1,015
  • 3
  • 15
  • 27

2 Answers2

0
  1. Log all your statements in a table
  2. Send them to the server via http
  3. Execute statements there on the server (ensure that there is no duplication by giving statements a serial no)
Brahma K
  • 1
  • 1
0

you can write an android service which can be called when the applicaiton starts. this service will start syncronization in the background while the application can fetch data from the database.

UPDATE

here is a sample tutorial for database.

Samuel
  • 9,883
  • 5
  • 45
  • 57
  • Yes you are right... this is the way to do it.. But where I am confused is version issue of the database. can you please provide some example..... – Parmendra Singh Aug 24 '11 at 08:49
  • you wont be changing versions of database unless you change the schema of the db when upgrading your application. – Samuel Aug 24 '11 at 08:54