how to use the legacy apache http client on android m ¬†using -'java,android,android-gradle,android-6.0-marshmallow'
On Android M, Google has completely removed the support of Apache HTTP client (link here) because it doesn't have good performance compared to the alternatives.
This might also be the cause for so many apps crashing on Android M.
Google allows to still use this API, just not as a built in one, by adding this line to the gradle file:
So, this is what I did :
¬†¬†¬†¬†buildToolsVersion "23.0.0 rc3"
When I tried it, it compiled fine (no errors being shown, and I could run the POC app, as it doesn't have any special code), but when I tried using some of the classes ¬†¬†that I know that are part of the old API (like "HttpClient" class), I see that it doesn't allow me to do so.
I know it's not recommended to use this solution, but we must have the app ready to work there at least temporarily, till we work 100% on all of the things that should change for Android M, and we don't want surprises in the form of crashes.
Here's a screenshot:
Why does it occur? Did I use it correctly ?
EDIT: reported about this issue here: