Skip to content Skip to sidebar Skip to footer

Http Client Api Level 11 Or Greater In Android

I have Restful Web Service implemented by Jersey. I connect from Android via HTTP client to fetch the data. It works fine in API level 10 and older versions but not on API level 11

Solution 1:

Are you performing the HTTP request on a separate thread (using an AsyncTask, for example)?

Some of the newer APIs (especially ICS, in my experience) forcefully require you to perform network connections on a separate thread so as to not block the UI thread. Network connections can be potentially long and expensive, so you never want to perform them on the UI thread. Doing so might prevent the UI from being drawn to the screen, cause your application to force close, make your application appear laggy to the user, etc.

Post a Comment for "Http Client Api Level 11 Or Greater In Android"