Skip to content Skip to sidebar Skip to footer

Clearing Application Database

I have an Android application which uses sqlite database to store textual data for a particular user. The data is read/written from/to the database from a service that runs periodi

Solution 1:

Well, this all depends on your logic for the application for the second part. I cant see why you would delete a database unless its just used to store temp data that does not matter. Either way the ideal place to do this check and delete is in the Data Access class thats opening the connection to the database. Below would be my logic...

  1. Call to open DB
  2. Check if DB file is old
  3. If yes, delete it
  4. Open Database (should create one if it does not exist)

Post a Comment for "Clearing Application Database"