title: Android: One vs many instances of HttpClient per application
body: <p>Until recently, our app shared a single Apache HttpClient instance using the ThreadSafeClientConnManager across the whole application. The http client instance was held by a singleton class.</p>
  
  <p>Since I dislike the singleton pattern for its numerous problems, I refactored our API accessor to be a per-thread object, but now for every thread (which mostly means per Activity/Service in our case) a new HttpClient instance is created.</p>
  
  <p>It's not that I have problems with this new approach, but I've read that the Apache folks suggest to only have one instance per app for performance reasons.</p>
  
  <p>Visually, what we did before was this:</p>
  
  <pre><code>HttpClient (thread safe)
            |
            |
           /\
          /  \
  Activity1...ActivityN
  </code></pre>
  
  <p>Now, we do this:</p>
  
  <pre><code>Activity1 ... ActivityN
      |             |
      |             |
  HttpClient1   HttpClientN
  </code></pre>
  
  <p>How do you guys do this in your applications? If you share one single HttpClient across your app and potentially many concurrent threads, how do you handle access to it?</p>