euitam
euitam

Reputation: 172

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.

Upvotes: 5

Views: 4117

Answers (1)

Leonardo
Leonardo

Reputation: 3189

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

Upvotes: 5

Related Questions