Android 6.0 以及HttpClient

來源:互聯網
上載者:User

標籤:

Android 6.0 SDK,API Level 是 23。更新之後,就可以修改 compileSdkVersion 和targetSdkVersion 到 23 體驗新的特性了。

同時 Android Support Library 也更新到了 23.01,同時發布的還有 customtabspercentrecommendationpreference-v7,preference-v14, 和 preference-leanback-v17 這些支援類庫。

在升級 APP 到 API Level 23 的過程中,請注意新平台特性帶來的一些新的許可權的處理。比如指紋識別,省電模式等,同時還有另外一個問題,那就是HttpClient已經過時了,如果在23目標版本,編譯會出現以下錯誤:

Cannot resolve symbol HttpClient

在sdk 23+已經不支援httpclient這個類了,取而代之的是你可以使用URLConnection,或者  用sdk 22

(compile‘com.android.support:appcompat-v7:22.2.0‘)

如果必須使用sdk 23,添加如下代碼:

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


 

參考連結: http://android-developers.blogspot.com/2015/08/m-developer-preview-3-final-sdk.html

              http://stackoverflow.com/questions/32153318/httpclient-wont-import-in-android-studio

Android 6.0 以及HttpClient

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.