0

Why am I getting error in using HttpClient and DefaultHttpClient though I am using sdk22 ? Can these be replaced with other classes?

Error while using HttpClient and DefaultHttpClient in android sdk 22

Triveni
  • 11
  • 1
    Those are not errors. They are deprecation warnings. That being said, you really should be moving to `compileSdkVersion` 25, and [then those classes are simply gone](https://stackoverflow.com/questions/32949626/org-apache-http-entity-fileentity-is-deprecated-in-android-6-marshmallow). – CommonsWare Dec 26 '16 at 12:24
  • you can use `HttpURLConnection` or a library to make network calls like Retrofit, Volley, OkHttpClient, etc – Kostas Drak Dec 26 '16 at 12:27

1 Answers1

0

you can use legacy httpclient like it's described here

How to add Apache HTTP API (legacy) as compile-time dependency to build.grade for Android M?

or you can download separate apache http client jar and import it in your module dependency

hope it helps.

Community
  • 1
  • 1
Oleg
  • 196
  • 1
  • 7