Does Android support multiple HTTP requests at the same time?

Romain Piel picture Romain Piel · Sep 21, 2011 · Viewed 18.9k times · Source

In my app I'd like to handle downloading of several files at the same time. To do so I'm starting several services, one for each request. As I'm not sure, does Android support simultaneous http requests in parallel?

In that case, is it good or bad habit to have one HTTPClient per request?

Many thanks for your help!

Answer

Peter Knego picture Peter Knego · Sep 21, 2011

HttpClient is not asynchronous and does not support parallel connections per se. You could have multiple threads each performing download with separate HttpClient instances.

You might also want to look at ExecutorService: http://developer.android.com/reference/java/util/concurrent/ExecutorService.html