When can RxJava become a pain in the ass?
The idea of this post is really simple. If you don’t know the details around RxJava - don’t implement it in a project which has the idea of earning money.
The idea of this post is really simple. If you don’t know the details around RxJava - don’t implement it in a project which has the idea of earning money.
Wonder how to check the network connectivity in Android? There is a new API that you can use but there aren’t many tutorials how to do it. Here is our simple way:
The RxJava approach I am currently working on an app where the devs before me took this strange decision in regard to the refresh token mechanism - have a single entry point of the app which is called every time whenever you need to have a fresh token. What I mean is this:
Problem Each Android app has an authentication mechanism or at least most of them do. What this auth mechanism does is that it refreshes an access token using a refresh token every N minutes. In our case these N minutes are 7. And now the question is: How do I implement this?
Testing data classes in Kotlin As we all know, data classes are final by default on Kotlin and if you try to use Mockito and mock such a class, you will get an exception. What you need to do is add this file:
I recently had a very strange bug when it comes to using a BehaviorSubject inside the object that I am testing.
mGetActiveHubUpdatesInteractor.getActiveHubUpdates() .filter(Optional::isPresent) .firstOrError() .map(Optional::get) .flatMap(activeHub -> mGetActiveHubEventsInteractor.getActiveHubEvents(activeHub, startTime, endTime)) .flattenAsObservable(list -> list) .map(mActiveHubEventUiMapper::toUiActiveHubEvent) .toList() .subscribe(this::populateEvents, this::handleError);
Recently, I had a very strange problem to debug. I had the following interactor:
Using RxJava with the architecture components from Google in the latest project that I was working on, it made me think how does error handling fit with the LiveData and can you keep the RxJava error handling which I find quite nice.