rx-java2 Questions
8
I keep studying and trying Reactive Style of coding using Reactor and RxJava. I do understand that reactive coding makes better utilization of CPU compared to single threaded execution.
Is there ...
Spalla asked 6/2, 2017 at 7:14
2
Solved
I was trying to imitate Google's codelab for the new Paging 3 library, and I encountered the following error when I tried to have a Room DAO method return a PagingSource:
D:\Programming\Android\som...
Capitulum asked 12/8, 2020 at 8:50
6
I have database with table contact and I want to check if there is contact with some phone number.
@Query("SELECT * FROM contact WHERE phone_number = :number")
Flowable<Contact> findByPhoneN...
Morry asked 6/7, 2017 at 9:41
4
Solved
I'm going to send a simple get method to my server(it is Rails app) and get the result using RxJava and Retrofit. The thing that I did is:
My interface:
public interface ApiCall {
String SERVICE...
Imp asked 16/4, 2017 at 5:34
6
I'm trying to observe observable on main thread by using:
// Kotlin Code
Observable
.observeOn(AndroidSchedulers.mainThread())
but I'm getting following error:
Type Mismatch:
Required: rx....
Tutorial asked 22/4, 2017 at 21:6
2
In 2020 a lot of android developers are talking about Kotlin Coroutines. I'm trying to understand it and how coroutines can help me in my project.
So my question: is there analogue in Coroutines f...
Caren asked 5/2, 2020 at 11:54
3
Solved
Why is my compiler not allowing myself to subscribe on an Observable with a TestSubscriber?
Here's my code:
TestSubscriber<User> testSubscriber = new TestSubscriber<>();
Observable.ju...
4
Solved
I would like to build a Repository class that returns a Single<Something>.
The class should first look in a Cache which returns Maybe<Something> and if the Maybe completes go off to my...
Scenery asked 11/12, 2017 at 16:2
9
Solved
I open example code BasicRxJavaSample (from this article Room+RxJava)
The main thing is there:
@Rule
public InstantTaskExecutorRule instantTaskExecutorRule =
new InstantTaskExecutorRule();
An...
Decima asked 1/1, 2018 at 11:6
2
Solved
How do I make a single row query with Android Room with RxJava? I am able to query for List of items, no issues. Here, I want to find if a specific row exists. According to the docs, looks like I c...
Racoon asked 13/4, 2018 at 22:14
4
My question can be a duplicate of How to use CompositeDisposable of RxJava 2? But asking to clear one more doubt.
According to the accepted answer
// Using clear will clear all, but can accept ne...
2
Solved
I have been doing TDD in Kotlin for these past few weeks now in Android using MVP. Things have been going well.
I use Mockito to mock classes but I can't seem to get over on how to implement one ...
Alarise asked 22/6, 2017 at 4:12
3
Solved
I'd like to know the best way to put my APIKEY in all my REST requests withtout having to add it in parameters of the request.
For now I just have a couple of calls, but I'm trying to see further....
4
Solved
TrendingViewModelTest
@RunWith(JUnit4::class)
class TrendingViewModelTest {
private lateinit var trendingRepository: TrendingRepository
private lateinit var trendingViewModel: TrendingViewModel...
Mcneal asked 23/9, 2019 at 7:46
1
I dispose my observable in onPause(), and I would like to restart it in onResume(). How can I do that?
Here is my observable:
Observable<ObdCommandResult> myObservable = Observable.create(...
Tiv asked 6/11, 2017 at 20:12
10
Solved
I am not getting the reason to use RxJava in Android and LiveData from Android Architectural Components.It would be really helpful if the usecases and differences between the both are explained alo...
Cero asked 20/9, 2017 at 3:44
3
Solved
Getting an UndeliverableException while using completable
public Completable createBucketWithStorageClassAndLocation() {
return Completable.complete()
.doFinally(() -> {
Bucket bucket =
stor...
3
Solved
I am trying to subscribe observable like :
List<String> colors = Arrays.asList("RED", "BLACK", "WHITE", "GREEN", "YELLOW", "BROWN", "PURPUL", "BLUE");
Observable.just(colors).subscribe(s -&...
3
Solved
For LiveData, is there something similar to blockingNext or blockingSingle in RxJava's Observable to get the value synchronously? if not, how can i achieve the same behavior?
Footbridge asked 27/4, 2018 at 20:29
3
Solved
I have an Activity in which I am creating and subscribing to multiple instances of the Single class (each instance is doing some work in a separate background thread). For each subscription, I'm ad...
2
Solved
I want to limit /test API call to be called once in 3 seconds, so for instance:
2021-09-21 14:09:19.920 V/OkHttp: --> GET https://xxx/test
2021-09-21 14:09:20.031 V/OkHttp: <-- 200 https://xx...
3
Solved
I am trying to understand the difference between delay and delaySubscription operators.
This documentation describes delay operator:
The Delay operator modifies its source Observable by pausing...
6
Solved
I am just learning Rx-java and Rxandroid2 and I am just confused what is the major difference between in SubscribeOn and ObserveOn.
Hemiplegia asked 8/7, 2017 at 9:41
1
Solved
In one of my android app, at first I want to call an api, which will return a list of item, and the item will be shown in a RecyclerView. I also need to call another api for each item of the Recycl...
Doubly asked 19/7, 2021 at 11:46
3
Solved
I have a ViewModel that is observing a RxJava Observable in my MainRepo class. I am trying to get my WebsocketListener in the MainRepo class to emit events, but I'm unsure how to do so.
MainRepo cl...
Lawerencelawes asked 1/6, 2021 at 4:49
1 Next >
© 2022 - 2024 — McMap. All rights reserved.