I want to use MediaStore.Images.Media ContentResolver to traverse all the images in the user device and to manage a seen\unseen status for each of the images such that my app wont show an image to the user twice, the traversal is continous, e.g the user should be able to hold the traversal and continue from the same point later.
My best idea of tackling that so far is based on having a SeenImages sqlite table containing handles to the images that the user already seen, and UnseenImages table containing handles to the images that user have not seen yet. When the user open app the app shows him an image from UnseenImages and after he saw it, it removes it and adds it to SeenImages, every time the UnseenImages table gets empty, the app will query the media ContentResolver for more unseen images using a NOT IN () clause containning all ids of images in the SeenImages tables.
The problem i see with this approach is that this would work great for small amount of SeenImages, but when SeenImages table gets big enough, I am worried about the length of the query having a very heavy NOT IN () clause.
Is there an alternative?
Aucun commentaire:
Enregistrer un commentaire