How to handle a queue to retry requests after a network failure using modification

I am coding an application and I will use retrofit lib to control network access. My question is how to handle network connection errors. My application can sometimes be used in areas without Internet access, but the user can interact with the application. So my question is how to handle some kind of queue to repeat requests that are in a failed state as soon as the network connection goes through the Internet? Or is there some kind of library to solve this problem?

Thanks in advance.

+5
source share
1 answer

A library that can partially do this work will be https://github.com/path/android-priority-jobqueue

Check their docs (which are pretty good by the way) to see if this helps. Although this may not be the solution, I think it would solve 80% of your problem!

Hope this helps

+5
source

Source: https://habr.com/ru/post/1205236/


All Articles