Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🏐 Volley library : make everything faster . Its an improvements for Volley by Google for Androidhttps://android.googlesource.com/platform/frameworks/volley

NotificationsYou must be signed in to change notification settings

DWorkS/VolleyPlus

Repository files navigation

Buy Me A Coffee

VolleyPlus

VolleyPlus library Project improvements to Volley along with full image caching.It involves usingRequestQueue,RequestTickle andRequest.

  • 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 ofRequest.

  • StringRequest
  • JsonRequest
  • JsonObjectRequest
  • JsonArrayRequest
  • GsonRequest
  • GZipRequest
  • MultiPartRequest/SimpleMultiPartRequest
    SimpleMultipartRequest request = new SimpleMultipartRequest(Method.POST, apiUrl, mListener, mErrorListener);    request.addFile("photo", imagePath);    request.addMultipartParam("body", "text/plain", "some text");    RequestQueue mRequestQueue = Volley.newRequestQueue(getApplicationContext());    mRequestQueue.add(request);    mRequestQueue.start();
  • DownloadRequest
  • ImageRequest

VolleyPlus has also very powerful image cachingSimpleImageLoder.

  • DiskLruBasedCache based onDiskLruCache for Level2 (L2) cache
  • SupportsNewtworkImageView usage 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

Usage

RequestQueue

RequestQueue mRequestQueue = Volley.newRequestQueue(getApplicationContext());StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {    @Override    public void onResponse(String response) {    ....    }}, new Response.ErrorListener() {    @Override    public void onErrorResponse(VolleyError error) {    ....    }});mRequestQueue.add(stringRequest);

RequestTickle

RequestTickle mRequestTickle = VolleyTickle.newRequestTickle(getApplicationContext());StringRequest stringRequest = new StringRequest(Request.Method.GET, url, null, null);mRequestTickle.add(stringRequest);NetworkResponse response = mRequestTickle.start();if (response.statusCode == 200) {String data = VolleyTickle.parseResponse(response);....}else{....}

SimpleImageLoader

ImageCacheParams cacheParams = new ImageCacheParams(getApplicationContext(), "CacheDirectory");cacheParams.setMemCacheSizePercent(0.5f);SimpleImageLoader mImageFetcher = new SimpleImageLoader(getApplicationContext(), R.drawable.holder_image, cacheParams);mImageFetcher.setMaxImageSize(300);....mImageFetcher.get(url, image_view);ORnetwork_image_view.setImageUrl(url, mImageFetcher);network_image_view.setDefaultImageResId(R.drawable.holder_image);

Quick Start

Volley is available as an AAR, so you just need to add the following dependency to yourbuild.gradle.

buildscript {    repositories {        jcenter()    }}...dependencies {     compile 'dev.dworks.libs:volleyplus:+'}...

Sample App

Get it on Google Play

Developed By

License

Copyright 2017 Hari Krishna DulipudiCopyright (C) 2011 The Android Open Source ProjectLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at   http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.

About

🏐 Volley library : make everything faster . Its an improvements for Volley by Google for Androidhttps://android.googlesource.com/platform/frameworks/volley

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors5

Languages


[8]ページ先頭

©2009-2025 Movatter.jp