What's the difference between principles of useLibrary and compile files('') in build.gradle?
After Android 6.0 releases, Support for the Apache HTTP client is removed. If our app is using this client and targets Android 2.3 (API level 9) or higher , HttpURLConnection class is recommended. It's said that this API is more efficient because it reduces network use through transparent compression and response caching, and minimizes power consumption. If we want to continue using the Apache HTTP API s, you must first declare the following compile-time dependency in our build.gradl e file: android { useLibrary 'org.apache.http.legacy' } The legacy jar is in Android SDK , whose path is sdk