Giter Site home page Giter Site logo

novate's Introduction

Novate

a safety client by Https for Android, (Android线程安全http请求库)

Summary

  • Join based API, reduce API redundancy
  • Offline caching
  • Support a variety of ways to access the network (a get, put, post, delete)
  • Support file download and upload
  • Unified support request header to join
  • The unity of the support to return the result
  • Support custom extensions API
  • Support the unified request access to the network flow control

#Download

Download the latest JAR:( com.tamic.novate-1.0.0.aar)

compile(name: 'com.tamic.novate-1.0.0', ext: 'aar')

or Gradle:

 compile project(':novate')

Snapshots of the development version are available in Sonatype's snapshots repository.

Retrofit requires at minimum Java 7 or Android 2.3.


中文文档

基于Retrofit和RxJava封装的链式请求库,为何起名 Novate?

Novate的英文原意是用新事物代替 我的目的是用新的东西来代替Retrofit的有些不易操作的地方,因此起名新奇的东西,所以结合了原来的Http用法习惯,又加入了Retrofit的特性,因此起名 :Novate

功能

  • 加入基础API,减少Api冗余
  • 支持离线缓存
  • 支持多种方式访问网络(get,put,post ,delete)
  • 支持文件下载和上传
  • 支持请求头统一加入
  • 支持对返回结果的统一处理
  • 支持自定义的扩展API
  • 支持统一请求访问网络的流程控制

用法

    Novate novate = new Novate.Builder(this)
            .baseUrl(baseUrl)
            .build();

Get

    novate.executeGet("pathUrl", parameters, new Novate.ResponseCallBack<NovateResponse<MyModel>>() {
    
        .....
    
    });

Post

    novate.executePost("pathUrl", parameters, new Novate.ResponseCallBack<NovateResponse<MyModel>>() {
    
       .............
    
    });

UpLoad

RequestBody requestFile =
                RequestBody.create(MediaType.parse("image/jpg"), new File(you file path));

  novate.upload(url, requestFile, new BaseSubscriber<ResponseBody>{
  
    '''''''''''''''
  });

DownLoad

  novate.download(downUrl, new DownLoadCallBack() {
  
     ''''''''''''
  });

Custom Api

如果默认的BaseApiService无法满足你的需求时,novate同样支持你自己的ApiService。

MyAPI

 public interface MyAPI {

   @GET("url")
  Observable<MyBean> getdata(@QueryMap Map<String, String> maps);

 }

Execute

 MyAPI myAPI = novate.create(MyAPI.class);

 novate.call(myAPI.getdata(parameters),
            new BaseSubscriber<MyBean>{
            '''''''
            });

}

novate's People

Contributors

tamicer avatar

Watchers

James Cloos avatar renzhiqiang 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.