Volley的加強版:VolleyPlus

jopen 10年前發布 | 47K 次閱讀 Android開發 移動開發 VolleyPlus

Volley的加強版,在Volley的基礎上進行了擴展擁有完整的圖片緩存,它涉及使用到了 RequestQueue, RequestTickle 和 Request

  • RequestQueue- Dispatch Queue which takes a Request and executes in a worker thread or if cache found its takes from cache and responds back to the UI main thread.
  • RequestTickle- A single class which takes a Request and executes in same thread or if cache found its takes from cache and responds back to the same thread. Mainly useful in sync operations where you want to perform operations sequentially.
  • Request- All network(HTTP) requests are created from this class. It takes main parameters required for a HTTP request like
    • METHOD Type - GET, POST, PUT, DELETE, HEAD, OPTIONS, TRACE, PATCH
    • URL
    • Headers
    • Parameters
    • Retry Policy
    • Request Priority (RequestQueue)
    • Request data (HTTP Body)
    • Request Cancellation
    • Response Caching
    • Successful Response Listener
    • Error Listener
    • Progress Listener (for few Request types)

VolleyPlus Provides variety of implementations of Request.

  • StringRequest
  • JsonRequest
  • JsonObjectRequest
  • JsonArrayRequest
  • GsonRequest
  • GZipRequest
  • MultiPartRequest
  • SimpleMultiPartRequest
  • DownloadRequest
  • ImageRequest

VolleyPlus has also very powerful image caching SimpleImageLoder.

  • DiskLruBasedCache based on DiskLruCache for Level2 (L2) cache
  • SupportsNewtworkImageViewusage withSimpleImageLoader
  • Can also update the cache
  • Provides option to flush, close and clear the cache in both L1 and L2 cache
  • Supported types of Image Caching
    • Network Caching
    • Resource Caching
    • File Caching
    • Video Caching
    • Content URI Caching


項目主頁:http://www.baiduhome.net/lib/view/home/1422862835413

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!