1. Download our Official Android App: Forums for Android!

Apps Developing App that does a lot of HTTP requests

Discussion in 'Android Development' started by VMCG, Apr 27, 2016.

  1. VMCG

    VMCG Lurker
    Thread Starter
    Mar 25, 2016

    Mar 25, 2016
    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?


Share This Page