I want to retrieve data from the database. The number of data is fixed and when new data is entered the oldest data is deleted. How can I do that? What to use to erase old data and store new data? I have 25 data location and there will always be new data.
Its android app and SQLite database is used.
I want to retrieve data from the database. The number of data is fixed
Share
Here is how you could implement that:
Create a column with type
NUMERICthat stores thelongvalue of a Date (Date.getTime()).Then when you insert a new row, delete any row with a column value smaller than your 25th row.