Clearing Application database

后端 未结 1 538
甜味超标
甜味超标 2021-01-24 08:04

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 peri

1条回答
  •  别那么骄傲
    2021-01-24 08:44

    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)

    0 讨论(0)
提交回复
热议问题