• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Developing App that does a lot of HTTP requests

VMCG

Lurker
Mar 25, 2016
3
0
I'm currently building an app that does a lot of HTTP requests, some requests need a response quickly and some can be queued. Two core parts of the app are:

- Orders
- Products

When a user logs in I pull down a list of orders to show a summary. Say there are 20 orders, I want to build a queue that will download the 20 orders. If a user then clicks on an order I want that order to instantly jump to the front of the queue if it hasn't yet been downloaded.

I have been doing a lot of research and believe a "Started" service is the best approach to handle the background downloads? Maybe a singleton class to handle the queue would be an easier option, the issue with this is that it would have to be maintained in every activity to make sure the queue is always being processed.

I also want when say a specific order is opened, that the service will send a message to whatever activity is currently open which will check if the request was related to the order that was just opened so I can update the UI.

Does anyone have any advice on how to best architect this app?
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones