dropbox-java-sdk wrapping with RxJava
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
gradle/wrapper
rxbox
sample
.gitignore
LICENSE.md
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

RxBox

v0.0.2[WIP]
This library makes dropbox-java-sdk easy to use with RxJava.

Including In Project For Gradle

repository:

repositories {
    maven { url 'http://yagi2.github.io/RxBox/' }
}

dependency:

dependencies {
    compile 'com.yagi2:rxbox:0.0.1'
}

Including In Project For Maven (unconfirmed)

repository:

<repositories>
    <repository>
        <id>yagi2-rxbox-repo</id>
        <url>http://yagi2.github.io/RxBox/</url>
    </repository>
</repositories>

dependency:

<dependency>
    <groupId>com.yagi2</groupId>
    <artifactId>rxbox</artifactId>
    <version>0.0.1</version>
</dependency>

Example

if you want get FullAccount.

in java project

RxBox.getCurrentAccount(DbxClientV2 client)
    .toSingle()
    .subscribe(new SingleSubscriber<FullAccount> {
        @Override
        public void onSuccess(FullAccount account) {
          // You can use account data here.
        }

        @Override
        public void onError(Throwable error) {
          // Error
        }
    }); 

in android project(use with RxAndroid, RxLifecycle)

RxBox.getCurrentAccount(DbxClientV2 client)
    .subscribeOn(Schedules.io())
    .toSingle()
    .compose(bindToLifecycle().<FullAccount>forSingle())
    .observeOn(AndroidSchedulers.mainThread())
    .subscribe(new SingleSubscriber<FullAccount> {
        @Override
        public void onSuccess(FullAccount account) {
          // You can use account data here.
        }

        @Override
        public void onError(Throwable error) {
          // Error
        }
    });

Sample for Android

Please get Full Dropbox API Key Developers - Dropbox
then, please replace "API_KEY" in values/strings.xml and AndroidManifest.xml.

$ ./gradlew clean assembleDebug

TODO

  • implementation more method.
  • separate API_KEY from String.xml.
  • create document.
  • add tests.