Search code examples
androidhttp

Asynchronous Http server in android


I'm implementing an asynchronous HTTP server in Android. I am using the code from the link http://hc.apache.org/httpcomponents-core-ga/examples.html (Asynchronous HTTP server). While compiling it I am getting the following errors and the application crashes:

java.lang.IncompatibleClassChangeError:org.apache.http.params.SyncBasicHttpParams 

in the line

HttpParams params = new SyncBasicHttpParams();

What is the cause and how to resolve it?

I am using the jars from httpcomponents-core-4.3-alpha1. enter image description here


Solution

  • There might be a beginning of answer on this thread : What version of Apache HTTP Client is bundled in Android 1.6?

    Indeed the error you get states that the SyncBasicHttpParams class you use is not compatible with the HttpParams class shipped in android. You should try to downgrade your apache libs to 4.0.X as indicated in the thread.