Does Android support multiple HTTP requests at the same time? Does Android support multiple HTTP requests at the same time? android android

Does Android support multiple HTTP requests at the same time?


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


When equipped with a pooling connection manager such as ThreadSafeClientConnManager, HttpClient can be used to execute multiple requests simultaneously using multiple threads of execution.

Here is a full example on how to use it: 2.9. Multithreaded request execution.

Update: It took a while, but the ThreadSafeClientConnManager is now deprecated (see excerpt below from Apache Http Client Removal):

Android 6.0 release removes support for the Apache HTTP client. If your app is using this client and targets Android 2.3 (API level 9) or higher, use the HttpURLConnection class instead. This API is more efficient because it reduces network use through transparent compression and response caching, and minimizes power consumption.


Do some testing to determine how many concurrent HTTPRequests work well.

I recommend starting one service and having many Threads rather than multiple services.