Sharing DefaultHttpClient in Android. To synchronize or not to synchronize?

Posted by johnrock on Stack Overflow See other posts from Stack Overflow or by johnrock
Published on 2010-05-22T19:00:55Z Indexed on 2010/05/22 19:50 UTC
Read the original article Hit count: 212

Filed under:
|

In an Android app, I am using one static instance of org.apache.http.impl.client.DefaultHttpClient and sharing that instance in all activities and services of the app, so that this client may be used to log in once to a remote server and all subsequent user requests to that remote server will remain authenticated.

Every activity or Service that makes a GET or POST to this remote server calls the same method : MyUtilityClass.gettHttpClient()

Do I need to worry about synchronization of this httpclient? If so, what is the best way to handle this?

© Stack Overflow or respective owner

Related posts about android

Related posts about httpclient