Questions tagged [rx-android]

RxJava bindings for Android

specific bindings for . RxAndroid module adds a number of classes to RxJava that make writing reactive components in Android applications easy and hassle free.

RxAndroid is open sourced and available under the Apache License, Version 2.0


Related tags

1768 questions
11
votes
1 answer

RxJava Break Chain on Conditional

I am creating an observable sequence and I am basically looking for a nice way to break the chain if a condition is not met. Ideally we could through an error in this scenario. This is basically to remove an if/else statement in a flatmap operator.…
Rich Luick
  • 2,354
  • 22
  • 35
10
votes
3 answers

multiple api request using retrofit and rx java

I am new to android and I have a scenario where I want to get get data from multiple api. Let suppose api_a, api_b, api_c, api_d. These api are independent of each other but I want to show data from these api in a mix Recycler View (horizontal and…
Android
  • 133
  • 1
  • 1
  • 10
10
votes
3 answers

Prevent emission if the same emission occurred x milliseconds ago

I would like to prevent an emission from occurring if and only if the same exact item was emitted within the last x milliseconds. I've looked at the throttle and debounce operators but I'm not sure if they can help me here. Is there another operator…
user2836797
10
votes
2 answers

Out of Memory Error RxAndroid + RxJava + Retrofit2

I am new to using RxAndroid and RxJava. I am using RxJava + Retrofit2 to make GET requests. I am doing approximately 1500 GET requests using the following code and getting Out of memory error. However the same code this time with only retrofit, NO…
Anil Maddala
  • 898
  • 16
  • 34
10
votes
3 answers

RX JAVA + Retrofit sdk generation using Swagger codegen

I want to generate sdk using swagger codegen which can give me generated sdk with Observable as callback like below : @POST("oauth/token") Observable < TokenResponse> getRepository(@Query("grant_type") String grantType);
rcde0
  • 4,192
  • 3
  • 21
  • 31
10
votes
1 answer

How to pass a key with null value or an empty String in the request body in retrofit android

I need to pass the keys even with no values as the keys are mandatory at the server side. But Retrofit was removing the keys with null values while sending the request. How I can achieve sending keys without values to the server with the use of…
NagarjunaAlaparthi
  • 101
  • 1
  • 1
  • 5
10
votes
1 answer

RxAndroidBle keeping a persistant connection + Write/Notification handling

I am building an Android application that has specific requirements regarding Bluetooth Low Energy. I need to write to a Write-only characteristic and receive responses on a separate notification characteristic, and I need to do it in many, many…
10
votes
1 answer

Android RxJava Observable.interval() doesn't stop emitting items

I have a static field private static Subscription timer; and two static methods: public static void setTimer() { timer = Observable.interval(2, TimeUnit.SECONDS, Schedulers.computation()) .doOnNext(tick -> update(tick)) …
Bashalex
  • 325
  • 2
  • 11
10
votes
2 answers

Android MVP with RxAndroid + Retrofit

Recently I started reading a lot about MVP and I want to get into practicing my projects with it. However I am not able to correctly understand where should Rx + Retrofit code go? I think it should be in Model Layer via Interactors but still can…
Rinav
  • 2,527
  • 8
  • 33
  • 55
10
votes
2 answers

Retrofit + RxJava fails to cache responses, suspected response headers

I'm trying to configure cache with Retrofit 1.9.0 and OkHtttp 2.5.0. Here is how I provide OkHttpClient for my RestAdapter: @Provides @Singleton public OkHttpClient provideOkHttpClient() { OkHttpClient okHttpClient = new OkHttpClient(); …
Jacek Kwiecień
  • 12,397
  • 20
  • 85
  • 157
10
votes
3 answers

Chaining RxJava observables with callbacks/listeners

I am using Retrofit with Observables, and would like to chain the observables. Usually it works well with functions like map() or flatMap(), since the api returns an Observable that does the task. But in this case I have to do the…
hiBrianLee
  • 1,847
  • 16
  • 19
9
votes
2 answers

RecyclerView Endless Scrolling with RxJava

I want to implement Endless Scrolling functionality on RecyclerView using RxJava. What I want: I want to fetch first 10 data from API call and display it in RecyclerView. After user scrolled down these 10 data, I want to make another API call and…
9
votes
5 answers

Executing delete with room (rxjava)

In room the @Delete annotation doesn't emit anything. This is what the dao looks like @Dao public interface UserDao { @Delete void deleteUser(User user); //We can't use Maybe or Single or anything here } This makes it a problem while…
Muhammad Ahmed AbuTalib
  • 4,080
  • 4
  • 36
  • 59
9
votes
1 answer

subscribeOn Android UI thread

I am new to RxJava and I think I am probably overlooking something very basic. So I have created an Observable that performs a long running I/O task like this. Now I want to make sure that subscriber receives its result on Android UI…