项目作者: jsaund

项目描述 :
Uploader for Android using RxJava
高级语言: Java
项目地址: git://github.com/jsaund/RxUploader.git
创建时间: 2017-03-22T03:24:10Z
项目社区:https://github.com/jsaund/RxUploader

开源协议:Apache License 2.0

下载


RxUploader for Android

A reactive Uploader for Android using RxJava and OkHttp

Installation

Add the following dependency to your project build.gradle file:
(note: Gradle is the only supported build configuration at this time)

  1. dependencies {
  2. compile 'com.github.jsaund:rxuploader:0.0.2'
  3. }

Usage

A new instance of the UploadManager can be constructed via the UploadManager.Builder.

  1. final UploadManager uploadManager = UploadManager.builder()
  2. .withUploadDataStore(dataStore)
  3. .withUploadService(service)
  4. .withUploadErrorAdapter(errorAdapter)
  5. .build();

Clients must implement a UploadService and UploadErrorAdapter. Optionally, clients can implement the UploadDataStore or use a SimpleUploadDataStore which persists Jobs to SharedPreferences.

The UploadService defines the interface for the UploadManager to interact with the remote server responsible for accepting files to be uploaded.

The UploadErrorAdapter defines which exceptions can be retried and what ErrorType they map to.

The UploadManager provides methods to enqueue a new Job, subscribe to status updates, and retry failed Jobs.

See rxuploader-sample project for a complete example.

Dependencies

RxJava

OkHttp

Gson

AutoValue

AutoValue-Gson

Retrolambda

License

  1. Copyright 2017 Jag Saund
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.