Questions tagged [rx-java]

RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.

RxJava is a Java implementation of Reactive Extensions. Android-specific support for RxJava is provided by .

The main goals of RxJava

  • Stay true to the principles and concepts behind the original implementation while adjusting to the naming conventions and idioms of Java
  • All contracts of Rx should be the same target - the JVM
  • JVM-based languages supported (beyond Java itself) include , , , and
  • Support Java 6+

The library is open sourced under Apache 2.0 license.

References

6958 questions
3
votes
2 answers

Retrofit 2 RxJava - Gson - "Global" deserialization, change response type

I'm using an API which always returns JSON object that looks like this: public class ApiResponse { public boolean success; public T data; } data field is a JSON object that holds all valuable information. Of course it's different for…
rafakob
  • 3,946
  • 3
  • 26
  • 36
3
votes
1 answer

rxJava, Refresh api data periodically

I am using the following observable to call retrofit api then save the response into cache file: @Override public Observable storyEntityList(final int page) { return this.restApi.storyCollection(id, page) …
Fshamri
  • 1,346
  • 4
  • 17
  • 32
3
votes
1 answer

RxJava - Where did AbstractOnSubscribe go in 1.1.0?

Version 1.1.0 just came out and it looks like they dropped rx.observables.AbstractOnSubscribe Removals from Public API Observable.onBackpressureBlock rx.observables.AbstractOnSubscribe Removal of stateful methods from the generic…
Malt
  • 28,965
  • 9
  • 65
  • 105
3
votes
1 answer

Retrying on same item after error

I'm trying to construct a robust processing pipeline with rx-java but I ran into a problem. Here is an example: public static void main(String[] args) { AtomicInteger div = new AtomicInteger(-1); Observable.just(1, 1, 1).map(item -> 1 /…
Reut Sharabani
  • 30,449
  • 6
  • 70
  • 88
3
votes
1 answer

Using Parse (Android) with RxJava

Background I'm using the Clean architecture in my android app. My domain and data layer are heavily RxJava-based (RxAndroid).I'm also using Parse(BaaS). Question I know that the Android Parse SDK is doing a lot of work under the hood like caching…
Rami Jemli
  • 2,550
  • 18
  • 31
3
votes
1 answer

Rx-Java centralized error handling

I use Retrofit as network library with Rx-Java. I want to make some centralized error checking for most requests and handle errors or pass it to subscriber's onError() if I cannot handle it. How could I do this? Something like this …
DmitryBorodin
  • 4,584
  • 4
  • 17
  • 29
3
votes
3 answers

rxJava transform List to Map

I have list coming back from a REST endpoint. I need to break that list down into categories (category is an item in each entry of the list). Individual categories will be written to a cache for faster lookup later. I didn't know if I could .map()…
dmfrey
  • 1,230
  • 1
  • 17
  • 33
3
votes
1 answer

Parallel execution of computationally expensive map

I am new to the ReactiveX library (I use its scala variant, RxScala). I have an Observable that emits values at high rate. I would like to apply a function to all values of the Observable (map). The function, which I use in map, is computationally…
3
votes
2 answers

RxJava: how to recover from errors in flatMap operator

I have an EditText where user inputs a search query and I want to perform an instant search on my server when user types something. I try to do this with RxJava as follows: RxTextView.textChanges(editQuery) // I'm using RxBinding for listening to…
netimen
  • 4,199
  • 6
  • 41
  • 65
3
votes
1 answer

Make Facebook Graph Request inside a RxJava Observable

I have a method that uses the Facebook Android SDK to asynchronously get the current user info. But when the user info are retrieved I have to convert the profile picture URL to a Bitmap, and I have to do this asynchronously too. So to download the…
regmoraes
  • 5,329
  • 3
  • 24
  • 33
3
votes
2 answers

Is it possible to re-subscribe to a Retrofit 2 observable?

I'm using Retrofit 2 with RxAndroid, and I want to keep a request going during a config change. I thought I could do it with Observable.cache() as described in this blog post and others I've seen, but the following flow causes an…
Jimeux
  • 2,956
  • 1
  • 18
  • 14
3
votes
2 answers

Tracing [rx] Observable exceptions in large graphs to source code

When you have a large Observable graph (i.e. observable composed many times using merge, groupBy, join etc.), and an exception is thrown, it is sometimes difficult to figure out where the exception originated from. I would like to know if it is…
Luciano
  • 2,388
  • 1
  • 22
  • 33
3
votes
1 answer

AsyncTask replacement with RXJava help needed

I am new to Reactive so go easy on me, but I am trying to replace an async task that is currently run on text changes for an auto suggest function. Below is where I am at with my RX: rest.getMemberList(etSearch.getText().toString())//rest interface …
Will Evers
  • 934
  • 9
  • 17
3
votes
1 answer

NetworkOnMainThreadException with retrofit-beta2 and rxjava

I recently upgraded from retroft-beta1 and this was working. I have the following interface for the API: public interface Service { @POST("path") Observable service(); } And the following call: service.service() …
bryant1410
  • 5,540
  • 4
  • 39
  • 40
3
votes
1 answer

rxjava and android.database.contentobserver

App uses RxJava to make network call, then modify results with data from database and display them. App listens to database changes with android.database.ContentObserver and modify data when there is change. Currently it works with code below but is…
Martin Vandzura
  • 3,047
  • 1
  • 31
  • 63
1 2 3
99
100