2

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

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

in the line

HttpParams params = new SyncBasicHttpParams();

Please let me know the cause and how to resolve it?

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

Thank you!

user1741274
  • 759
  • 3
  • 13
  • 25

1 Answers1

0

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.

Community
  • 1
  • 1
Snicolas
  • 37,840
  • 15
  • 114
  • 173
  • Hi, Thanks for your reply. I just found that org.apache.http.nio.protocol.HttpAsyncService is not bundled with Android. Please post your suggestion to a separate question http://stackoverflow.com/questions/13816537/handling-http-get-delete-android-using-rest. @Snicolas – user1741274 Dec 17 '12 at 11:02
  • There is no link with this question and my answer. – Snicolas Dec 17 '12 at 13:50
  • I meant if you have any ideas of how to make asynchronous(non blocking) HTTP server in Android, post to the above link. Thanks. @Snicolas – user1741274 Dec 17 '12 at 13:57