Use caching and lazy-loading to avoid loading animations or an empty UI
To reduce the number of loading animations or empty UI seen–in cases with no or slow network connection or during polling of the various backend chat services–the app should store the most recent items of conversations and lazy-load the rest.
Using lazy-loading should cut down on the initialization time by not trying to load everything at once from every chat service and only load what is relevant to the initial user experience of the messaging app. i.e. the app should load only the most recent portions of conversations and lazy-load later portions, multimedia (since photos, videos are larger), etc. in the background or when the user attempting to view older portions of conversatoins
- first load the titles or names of contacts for conversations (as to fill the conversations view)
- then, first 20 or so text-only message entries (enough to populate the chat window for every conversation, so when it's entered into it's not empty/loading)
- finally, the rest of conversations (in the background, and lazy-load them when someone scrolls past a certain threshold in a chat window)
The most recent items of a conversation should also be stored at all times so the UI is not empty when there is no network connection, past items in a conversation should be securely cached and only loaded when a user is scrolling back in a conversation view.
No Network Connection
Only when someone is trying to load remote content (again by scrolling back in a conversation history) or attempting to send a message should we show an error/warning that reminds them they have no network connection.