Save Your Backend From Responsive Ui

In this article I will describe one solution on a comments voting feature to prevent making too much network requests, while keeping your UI responsive.

Lately I’ve been implementing a Commenting feature in our Android app for the Daily Mirror Newspaper, alongside with a Like/Dislike voting mechanism. Similarly to Reddit, you can vote for a LIKE, DISLIKE and NONE:

Typically when doing a network request on Android one has to:

Start asynchronous work Wait for network response Update UI accordingly (success or error scenarios) Literally following this pattern would make the UX a bit boring and so I followed an approach suggested by Yigit Boyar in this talk on designing offline-first applications. This can also be viewed as taking an optimistic approach on UX (https://uxplanet.org/optimistic-1000-34d9eefe4c05)