3

I am building an app that will make a web request whenever you scan a qr code. If you have internet available, making that request is easy. If we don't have internet, I want to put it onto a queue and make those requests whenever I have internet on a background thread. What is the best approach to handling this and what libraries should I be using?

Arham Akbar
  • 41
  • 1
  • 4

1 Answers1

0

Since Intents are Parcelables I would use a IntentService to handle Intents of the request and store then on file or sharedpreferences if no internet connection is available, also, on this approach you could listen for connectivity broadcasts, wake up the service and restart the queue, notifying the user from completion or your own application if it already open.

Marcos Vasconcelos
  • 18,136
  • 30
  • 106
  • 167