android api23 抛弃了httpClient,许多基于httpClient第三方库怎么办?


android sdk升级了api23,原生sdk不提供org.apache.http.*的类(仅仅保留几个)。java上最常用的httpClient也没有了。

一直使用android-async-http、android-ImageLoader等第三方库,都要引用httpClient,这样的话,是要去apache官网下载httpClient.jar来用吗?

Android java android-async-http httpclient

南斗来一发 8 years, 8 months ago

 // Apache Http
android {
    useLibrary 'org.apache.http.legacy'
}
// Header
dependencies {
    compile "org.apache.httpcomponents:httpcore:4.3.2"
}

kagome answered 8 years, 8 months ago

To continue using the Apache HTTP APIs, you must first declare the following compile-time dependency in your build.gradle file:

android {


 useLibrary 'org.apache.http.legacy'

}

无敌南千秋 answered 8 years, 8 months ago

Your Answer