In my Android application, I use to call more AsyncTasks in order to execute REST requests to a server (GET/POST to retrieve images, and other informations as real-time feed). Imagine a scenario like this: I have a main activity with a ListView and an associated Adapter showing a lot of views having images. These images are loaded dinamically from cache or if missing from web through a REST request to a server. The request operate as follow: -the app instantiate a new AsyncTask having in doInBackground a POST request (for example) with HttpUrlConnection class. When the response is ready and retrieved I execute a callback to the java class that needs the info.
The problem is present when a request is waiting for result and the other requests are freezed for completion of the first. Imagine that the server take time to elaborate a request and a set of images needs to be loaded. The first take a while and block the loading of other images taking GUI incomplete.
How can I manage simultaneous tasks with REST requests? Is AsyncTask the right way to operate or should I use something else?
Thank you