# Wrapping Existing Libraries with RxJava

DevFeed: [Wrapping Existing Libraries with RxJava](<https://devfeed.tech/articles/wrapping-existing-libraries-with-rxjava-30581.md>)

Original publisher: [Read original article](<https://ryanharter.com/blog/2015/07/wrapping-existing-libraries-with-rxjava/>)

Published: 2015-07-07T07:00:00Z

Content type: tutorial

Language: en

Sources: [Blogs on Ryan Harter](<https://devfeed.tech/sources/blogs-on-ryan-harter.md>)

Topics: [RxJava](<https://devfeed.tech/topics/rxjava.md>), [reactive](<https://devfeed.tech/topics/reactive.md>), [Android](<https://devfeed.tech/topics/android.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Library](<https://devfeed.tech/topics/library.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [callback](<https://devfeed.tech/tags/callback.md>), [code](<https://devfeed.tech/tags/code.md>), [exception](<https://devfeed.tech/tags/exception.md>), [functional](<https://devfeed.tech/tags/functional.md>), [interface](<https://devfeed.tech/tags/interface.md>), [java](<https://devfeed.tech/tags/java.md>), [library](<https://devfeed.tech/tags/library.md>), [reactive](<https://devfeed.tech/tags/reactive.md>), [rxjava](<https://devfeed.tech/tags/rxjava.md>)

## AI overview

A tutorial on adapting existing listener-based libraries for use with RxJava. It explains when to use synchronous calls with create() and how to wrap asynchronous listener callbacks with Observable-based APIs, using OpenIAB as the example.

## Source excerpt

RxJava is all the rage in the Android world lately, and with good reason. While Functional Reactive Programming has a bit of a steep learning curve, the benefits are enormous. One issue I've run accross is the fact that I need to use libraries that don't support RxJava, but use the Listener pattern instead, and therefore miss out on many of the composability benefits of Rx. I ran into this exact issue while integrating OpenIAB into the latest release of Fragment. To make matters more difficult, OpenIAB uses startActivityForResult to actually launch a new Activity and return a result. That made me wonder, how can I use OpenIAB with RxJava?