Hi guys,
Let's say I have a simple chat application where messages are being constantly appended. The different conversations each have unique ID's and contain the different message items that have been sent in this conversation in a chronological order. Each message has some keys that are necessary to correctly display the message. So far for the setup.
Now, the problem is, when a conversation is getting bigger, the download times obviously are getting to long, so I need to implement a pagination system. Here comes the big question: how shall I do that? Any quick suggestion? I already thought about consecutive message ID's, but that's obviously not a good way to get to my goal. Another way would be to maybe sort 50 messages in a page1, the next 50 messages in page2 and so on, but then there's the problem that I don't know how many pages currently exist and that page1 (containing the 50 first messages, thus the "oldest" messages) is not the most recent page if there is more than one page, and that those messages won't be displayed first, but effectively as the last ones when the user taps on a "load more messages" button.
So, is there anyone who's had that problem and can come up with an easy solution I didn't think of yet?
Best regards,
Eric