4. Android架構之 android-async-http

來源:互聯網
上載者:User

標籤:

1. android-async-http   簡介

主要有以下功能:

(1)發送非同步http請求,在匿名callback對象中處理response資訊;

(2)http請求發生在UI(主)線程之外的非同步線程中;

(3)內部採用線程池來處理並發請求;

(4)通過RequestParams類構造GET/POST;

(5)內建多部分檔案上傳,不需要第三方庫支援;

(6)流式Json上傳,不需要額外的庫;

(7)能處理環行和相對重新導向;

(8)和你的app大小相比來說,庫的size很小,所有的一切只有90kb;

(9)在各種各樣的移動串連環境中具備自動智能請求重試機制;

(10)自動的gzip響應解碼;

(11)內建多種形式的響應解析,有原生的位元組流,string,json對象,甚至可以將response寫到檔案中;

(12)永久的cookie儲存,內部實現用的是Android的SharedPreferences;

(13)通過BaseJsonHttpResponseHandler和各種json庫整合;

(14)支援SAX解析器;

(15)支援各種語言和content編碼,不僅僅是UTF-8;

附註:

android-async-http項目地址:https://github.com/loopj/android-async-http

android-async-http文檔介紹:http://loopj.com/android-async-http/

 

2. android-async-http 的使用

  • 在匿名callback回調中處理response資訊

 

4. Android架構之 android-async-http

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.