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.
Continue reading “When can RxJava become a pain in the ass?”Category: Android
Detecting network change with ConnectivityManager & RxJava
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:
Continue reading “Detecting network change with ConnectivityManager & RxJava”Android Oauth2 token refresh mechanism – OkHttp vs RxJava layering
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:
Continue reading “Android Oauth2 token refresh mechanism – OkHttp vs RxJava layering”Execute an RxJava observable only once in a given time period
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?
Continue reading “Execute an RxJava observable only once in a given time period”Tricky parts when implementing unit tests for Android in Kotlin
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:
Continue reading “Tricky parts when implementing unit tests for Android in Kotlin”Running unit tests for LiveData with Jupiter on Android
Running unit tests for ViewModels on Android where you have LiveData objects can be tricky. It is very possible that you get this exception:
java.lang.RuntimeException: Method getMainLooper in android.os.Looper not mocked.
Continue reading “Running unit tests for LiveData with Jupiter on Android”Creating a SonarQube custom plugin for Kotlin
In Android we decided that we want to implement a unit test performance monitor. The reason for it is that sometimes some unit tests would execute in more than 1 second and it was all because we would use the Schedulers.trampoline() RxJava scheduler instead of the TestScheduler which is part of the RX package.
Continue reading “Creating a SonarQube custom plugin for Kotlin”Android Notification White Square Icon
We have all seen the white square at the top type of a notification in the notification bar.
Continue reading “Android Notification White Square Icon”Android Studio Live Templates
I was really wondering how I can remove repetitive tasks from Android Studio by assigning shortcuts or tags and I found that IntelliJ has Live Templates which I bet that little programmers use. So as an example I wanted when I type the word “tag” within a class the following to be autocompleted:
Continue reading “Android Studio Live Templates”Android adb server version (32) doesn’t match this client (Genymotion)
Probably you have seen this type of error when using Genymotion as the Android emulator on which you test your device. This is how the error looks like:
adb server version (32) doesn’t match this client (35); killing…
error: could not install *smartsocket* listener: Address already in use
ADB server didn’t ACK
* failed to start daemon *
There is one simple thing that worked for me. I opened the Settings menu of Genymotion, then ADB tab and selected: Use custom android SDK tools and I set the path to the tools. By default Genymotion uses its built-in tools. After that killing all working emulators and starting them again makes everything work.
Hope I have helped!