How to implement "favorites list" in java & android?

0 like 0 dislike
24 views
Good day!
Decided to improve my skills to write small application in java. I would like to find the answer to the next question. There is a sqlite DB with a list of information. Information you can add to "favorite list". How exactly to implement this list in order the next time you open the application to download data and to update the application data is not lost? How and where to save this information?
Possible ideas -
1) Create an ArrayList and add the id of this information to serialize and write to a separate file.
2) Create a column isSelected (bool), and every time you load from the database (then the application must also write to the DB information). How then will this affect the updates (the database will also be updated)
3) Create a separate table in the database

Thank you in advance for the info.

PS for example, this source: https://stackoverflow.com/questions/7957319/how-to... is recommended to create a separate table in the database
by | 24 views

1 Answer

0 like 0 dislike
A separate table using a FOREIGN KEY (ON DELETE CASCADE) Here details, search by keywords
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
4 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
110,608 questions
257,186 answers
0 comments
33,912 users