Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle a queue to repeat requests after network failure with retrofit

I'm coding an app, and I will use retrofit lib to handle network access. My question is about how to handle network connection errors. My app may sometimes be used in zones with no internet access, but the user may be able to interact with the app. So my question is how to handle some kind of queue to repeat requests which are in failure as soon as network connection passes online ? Or is there some kind of library to handle this type of problem ?

Thanks in advance.

like image 696
euitam Avatar asked Oct 21 '14 22:10

euitam


1 Answers

A library that may partially do the job for you would be https://github.com/path/android-priority-jobqueue

Check their docs (which are pretty good btw) to see if it helps. Altough it might not be the solution I think it would resolve 80% of your problem !

Hope it helps

like image 106
Leonardo Avatar answered Sep 29 '22 07:09

Leonardo