Apache Http Customer Removed From Android 6.0 Release

Posted on

Android 6.0 unloosen removes back upward for the Apache HTTP client. If your app is using this customer in addition to targets Android 2.3 (API marking 9) or higher, purpose the HttpURLConnection shape instead. This API is to a greater extent than efficient because it reduces network purpose through transparent compression in addition to reply caching, in addition to minimizes ability consumption.

To maintain using the Apache HTTP APIs, you lot must rootage declare the next compile-time dependency inwards your build.gradle file:

android {     useLibrary 'org.apache.http.legacy' } 

Have to sync Gradle projection later you lot insert the inwards a higher house code in build.gradle file.

Reference: Android 6.0 Changes – Apache HTTP Client Removal


Related examples of using Apache HTTP customer and HttpURLConnection:
– Android App to command Standalone ESP8266/ESP-12 on-board LED, using Android 6.0 removed HttpClient
– Android App to command Standalone ESP8266/ESP-12 on-board LED, using HttpURLConnection