RxBolts

Android Arsenal JitPack Download javadoc Build Status ![Methods Count](https://img.shields.io/badge/Methods and size-core: 54 | deps: 4111 | 6 KB-e91e63.svg) Gitter Chat Coverage Status Codacy Badge

Reactive Bolts-Android. Allow convert Task<T> to Observable<T>.

Usage

TaskObservable.defer():

TaskObservable.defer(() -> Task.forResult("Hello, world!")).subscribe(it -> {
  System.out.println(it);
});

Take 5 users using Parse:

TaskObservable.defer(() -> ParseUser.getQuery().findInBackground()).flatMap(Observable::from).take(5).subscribe(user -> {
  System.out.println(user.getObjserId());
});

Update location of 5 users using Parse:

TaskObservable.defer(() -> ParseUser.getQuery().findInBackground()).flatMap(Observable::from).take(5).flatMap(user -> {
  user.put("location", "Taipei");
  return TaskObservable.defer(() -> user.saveInBackground());
}).subscribe();

Error handling

Failed:

TaskObservable.defer(() -> Task.forError(new RuntimeException("An error message."))).subscribe(it -> {}, e -> {
  e.printStackTrace(); // RuntimeException
});

AppLinks

javadoc

AppLinkObservable.navigate(context, url, resolver);
AppLinkNavigation.setDefaultResolver(resolver);
AppLinkObservable.navigate(context, url);

Sample code

Installation

For RxJava2

Via jitpack.io

repositories {
    jcenter()
    maven { url "https://jitpack.io" }
}

dependencies {
    compile 'com.github.yongjhih.RxBolts:rxbolts2:-SNAPSHOT'
    //compile 'com.github.yongjhih.RxBolts:rxbolts2-taks:-SNAPSHOT'
    //compile 'com.github.yongjhih.RxBolts:rxbolts2-applinks:-SNAPSHOT'
}

For RxJava1

via jcenter

repositories {
    jcenter()

}

dependencies {
    compile 'com.infstory:rxbolts:1.0.1'
}

Or via jitpack.io

repositories {
    jcenter()
    maven { url "https://jitpack.io" }
}

dependencies {
    compile 'com.github.yongjhih.RxBolts:rxbolts:-SNAPSHOT'
    //compile 'com.github.yongjhih.RxBolts:rxbolts-tasks:-SNAPSHOT'
    //compile 'com.github.yongjhih.RxBolts:rxbolts-applinks:-SNAPSHOT'
}

Development and deploy to jcenter

rxbolts:

./gradlew :rxbolts:build :rxbolts:bintrayUpload

See Also

ref.

LICENSE

Copyright 2015 8tory, Inc.

Licensed 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.0

Unless required by applicable law or agreed to in writing, software distributed 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 and limitations under the License.

Become a better Android Developer
Millions of developers are learning at MindOrks

Online Training Program

Featured Blogs

Our Team

MindOrks is Certainly one of the best online blog to stay on top of all the Android development news, coding and design patterns. Finally a blog I can count on to keep myself updated with latest and greatest things happening in Android world.

Vipul Shah
Android Developer
Microsoft

Become Pro in Android by watching videos

OUR LEARNERS WORK AT