Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [rx-java]

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

2
votes
0answers
43 views

Listing YouTube videos using API with RxJava

I am new to RxJava and have the following code which I use to search YouTube videos via the API and ultimately display them in a list. ...
1
vote
0answers
52 views

Consuming APi using Rx in an MVP project

I would like to have some input here if possible, this code should make a request to an API and the call should return the desired object. The client to make the requests was made with Retrofit and ...
1
vote
0answers
20 views

Conditionally perform asynchronous actions with RxJava

This seems to work fine however I'm sure there must be a neater way. The outcome should be: If isHidden == true then call canHideAccount. canHideAccount returns a Single. If isHidden != true then ...
2
votes
1answer
43 views

Parsing CAN frames from a ByteArray

Here's my method used for parsing a ByteArray into multiple frames of CAN interface. It works now correctly but it's somewhat ugly in my opinion. It's written in ...
0
votes
1answer
122 views

Async Task using RxJava2 in Android

I have tried to create the async task using the RxJAVA2. The code is working fine. WHat enhancement can I do in this code? ...
2
votes
1answer
153 views

About handling data from an API call through RX and Retrofit

I started using Retrofit and RxJava recently and I love it. I am working on an Android project and I am following MVP Repository pattern as specified in Android Architecture Components. I'm still ...
1
vote
0answers
49 views

Pushing a value to a Processor on a separate thread

I am attempting to use Room along with a full-text search (FTS) table. The issue is that Room doesn't recognize or support FTS tables. Though there is a work around for this; you just create the FTS ...
1
vote
0answers
55 views

Subscribing to multiple sources in RxJava

I have used RxJava to Observe multiple sources and then perform action depending upon values of Observables. I want to know if it can be further simplified. Goal: Complete implementation of RxJava. ...
3
votes
1answer
101 views

Getting products for category

I have a PR for a bugfix in which the fix is just 4 characters. In this situation we are invited to make some refactoring on the class that we are touching if possible. Venkat Subramaniam's advice is ...
1
vote
0answers
47 views
1
vote
0answers
207 views

My first use of RX-java with Kotlin and vertx

I extracted a small part of my project, it is a workflow engine based on vertx rx-java and Kotlin. This part represent the code use to manage Bpmn Service task. The workflow is a stack of ServiceTask ...
0
votes
1answer
145 views

Dagger 2 test application

I have a complicated Dagger 2 use case on Android, where I have a lot of dependencies, but some of them are really slow to construct. Like 2-3 seconds slow. My solution was to create an RX ...
3
votes
0answers
730 views

RxJava2 custom Observable

I'm trying to understand how to bridge receiver-based events to the Reactive world. I asked a question on SO and was pointed to a different approach. The author of that answer (David Karnok) is ...
2
votes
0answers
2k views

Repository pattern with Specification queries

I'm working on an Android (Java) project which utilizes different analytic metrics (sum of x group by date, sum of x group by id, etc) and I am projecting the data sets into different charts using ...
2
votes
0answers
45 views

Asynchronous service that publishes a possibly infinite amount of events

I want to implement a service that fetches eyetracking events and publishes them to all subscribers of the stream. The whole thing is supposed to run asynchronously, so it doesn't block the UI thread. ...
5
votes
1answer
158 views

Creating new async tasks

In the past, I have used AsyncTasks to perform network requests for my Android app. I recently switched to RxJava to be able to cancel the requests when the user exits an activity. I have created a ...
5
votes
0answers
104 views

User role Observable

I have a service with these methods: Observable<User> getUsers(); Observable<Role> getUserRoles(String userId); For each user, I want to get her ...
2
votes
0answers
67 views

Refactoring App launch sequence using reactive programming

In the SplashActivity of my Android Application, the following sequence of events occur: Check if Google Play Services is installed If Google Play Services are ...
4
votes
1answer
4k views

Testing a ViewModel in Android - MVVM with DataBinding

I am using MVVM pattern with databinding. I have written tests. But I want them reviewed. The test is related to JUnit test on the ViewModel. FeedViewModelTest....
0
votes
1answer
85 views

Finding the mean using RxJava

I'm learning RxJava and this is what I attempted to find the mean of 'n' transactions. ...
1
vote
0answers
47 views

Testing a method which coordinates multiple objects

I have this class with one method, which uses three different objects to perform a task. ...
0
votes
1answer
404 views

Getting data with RxJava and retrofit

I am using RxJava with retrofit to get data from an API then filtering the data with a for loop in the onNext Method. Is there ...
3
votes
2answers
811 views

Cache of shared observables (Rx)

So the idea is to maintain a cache of shared Observables - accessible by a key - which if not present will produce one using the given factory. The underlying shared Observable is accessed via an ...
3
votes
1answer
57 views

RXJava operate on exiting List instead of creating new

I'm dipping my toes in to RXJava for the first time. The function below works just fine but I can't help thinking it can be improved. For instance I'm sure that I'm unnecessarily creating a new ...
5
votes
1answer
547 views

Finding local C# servers on a Java client using UDP and reactive extensions

This program uses UDP broadcast to find app servers on the local network. When a server receives a client broadcast, it sends a port (integer) to the client which will later be used to create a TCP ...
1
vote
1answer
221 views

Android UI code for a test job

I wrote my first Android UI application for a test job, but it was declined as employer said that he did't like "the code quality". He didn't specify what he meant. But I'm very interesting to know ...
3
votes
1answer
941 views

Manager for OAuth2 tokens using RxJava

I have a class in my application which manages storage of OAuth2 tokens. There are unauthenticated tokens (in my code, called "application access tokens") which can be used for API calls that do not ...
3
votes
1answer
451 views

Coordinating Threads with Reactive Streams

I just started learning reactive streams with RxJava. After reading a couple of books and a lot of articles our there I am still having trouble understanding how to coordinate multiple threads. I ...
3
votes
0answers
497 views

Using combinations of OR and AND filters with RxJava

I'm trying to work out a way to create a combination of OR and AND filters in RxJava. Here's what I've done so far: ...
3
votes
1answer
459 views

Using a Subject to trigger a music list to reload

In my Android app I have a Service that is periodically polling a server for a music playlist XML. For certain occasions I also want to trigger a reload manually. I am using Retrofit for the server ...