I am developing a twitter client for android.
I'm doing this a practice project and I need some help regarding storing the tweets in the timeline.
Can anyone suggest the best strategy for storing the tweets in the timeline?
What I need to do is to store the tweets in the database:
- a max of 50 tweets
- when newer tweets are available then add newer ones
- but still making sure that the elements in the database does not exceed 50
And also I intend to set an expiration date for the tweets, that is to delete all the tweets in db if not updated for a certain amount of time.
I specifically don't need code. Just a strategy/algorithm to get me on the right path. What do the apps in the android market employ?
preguntado el 01 de febrero de 12 a las 14:02
I think that it would be the best to write a database trigger which would remove oldest entry upon inserting a new record, if total record count exceeds 50. Shouldn't be that hard, since almost all databases support database triggers.
I just answered this question for someone else. Use a trigger like in this https://www.youtube.com/watch?v=xB-eutXNUMXJtA&feature=youtu.be