1

In my application I have a sqlite database.The columns in this database are :- id, data,date-added, mydescription.

And android content provider Media.Image.External has following columns in its database:- _id , _data , _title , _date-added ,....and so on.

I want that whenever application is launched, my database gets synced with content provider database(only id, data, and date-added columns). So If android content provider database has an addition of row, my database also adds that row and if any row is deleted, then my database also deletes that row.

So how to achieve this thing.

Thanks

Ankesh kumar Jaisansaria
  • 1,563
  • 4
  • 26
  • 44

1 Answers1

0

You can use Application class.

It is a singleton and guaranteed to start before your any Activity.

Inside it query data with the help of Cursor Loader. If the content provider correctly implemented you will get new data for every update in the DB.

Maxim G
  • 1,479
  • 1
  • 15
  • 23