5

I am working on an android(Java) project where I want to update my SQLite database with a remote MySQL database info.

Initially I want to create the SQLite DB as exact remote MySQL database. After that Application normally deal with the SQLite DB.

Then when application shut down and start again if any modification happened to remote MySQL database I want to sync sqlite database with the MySQL database info.

Can anyone give any idea how I can accomplish this task. Thank you

0

2 Answers 2

1

You can use android service API android.app.Service for achieving this.

You just have to run a service which will check the server database changes and if there is changes get the data from the server.

But to run that service you have to write a BroadcastReceiver which will tell service to run after specified time or after application started depending upon the requirement

Sign up to request clarification or add additional context in comments.

Comments

0

Use an Account Authenticator? Alternatively use a service API (See Google I/O talk on you tube http://www.youtube.com/watch?v=xHXn3Kg2IQE fast forward to 37:37)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.