Giter Site home page Giter Site logo

volley's Introduction

volley框架改进版
根据公司的需要,主要改进内容:
1、优化二次封装接口;
2、添加wifi下强制数据网络访问开关;
3、修复部分bug;
4、删减部分扩展类和辅助类,精简框架。

引入方式:在build.gradle中加入以下:
    android {
        ......
        useLibrary 'org.apache.http.legacy'
    }

    dependencies {
        ......
        compile 'com.bfy:volley:1.0.4'
    }


混淆规则:
    -keep class org.apache.http.**
    -keep class cn.bfy.volley.Request {*;}
    -keep class cn.bfy.volley.RequestQueue {*;}
    -keep class cn.bfy.volley.toolbox.HttpStack {*;}
    -keep class cn.bfy.volley.toolbox.Volley {*;}
    -keep class * extends cn.bfy.volley.Request {*;}
    -keep class cn.bfy.http.** {*;}

简单用法:
    RequestManager类为主要接口类,里面提供了init()、post()、get()多种重构方法,其中init()为
初始化方法。
    RequestManager.getInstance().init(this);
        String url = "http://pv.sohu.com/cityjson";
        RequestManager.getInstance().post(url,null, null, new StringRequestListener() {
          @Override
          public void onRequest() {

          }

          @Override
          public void onFinish(String data, Map<String, String> headers, String url, String actionId) {
              Toast.makeText(MainActivity.this, data, Toast.LENGTH_SHORT).show();
          }

          @Override
          public void onError(String errorCode, String errorMsg, String url, String actionId) {
              Toast.makeText(MainActivity.this, errorMsg, Toast.LENGTH_SHORT).show();
          }
          }, UUID.randomUUID().toString());

volley's People

Stargazers

shiee77 avatar ouyangjinfu avatar

Watchers

ouyangjinfu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.