Retry Sometimes Using RetryWhen

Continuing from the last post. Last week I was working through a way of retrying attempts. As a result, I thought of an easier way of retrying. Previously, I demoed a way to do this recursively. But I realized there is an easier way. Namely, using the RetryWhen operator. As I was working through it, I had a bright idea. …

Retry Sometimes in RxJava

If you’ve ever looked into retrying in RxJava. You’ll know there are two operators for retrying. First, repeat is for when a completion event. In addition, retry is for when an error event. Maybe, you find yourself asking about retrying with a regular onNext event. In particular what if you only want to sometimes retry in RxJava? This is the …

Creating Type Safe Builders In Kotlin

An Easy Example Today we are going to cover creating Type Safe Builders. If you’ve heard of Kotlin’s DSL or Domain Specific Language capabilities this is what they are referring to. A Type Safe Builder is really just that. It’s building an object in a particular domain. For example if you are working on code for a purchasing system then …

What RxJava Book Should I Buy?

If you’re here you’ve probably asked yourself “What RxJava Book Should I buy?” I’ve seen this question a number of times. If you are looking at picking up a RxJava Book you should first know that there are two major versions of RxJava. Since version 1 has a limited support time line all new projects should be using RxJava v2.  …

kotlin

Is Kotlin a Fad? Should I learn Kotlin? Is Kotlin a Fad? I was an early adopter and this was a common question I came across.  While I loved Kotlin this wasn’t a question that I could answer.  Fortunately I ended up on the correct side, and it’s safe to say NO.  Kotlin is not a Fad.  Google’s decision to …

RxKotlin Multiple Observations

If you’ve been doing android development with RxJava or RxKotlin you know that it’s a steep learning curve. RxJava is a great skill that every android developer should have in their toolbox. It makes writing android apps much easier. I’m constantly learning new things with RxJava, and applying what I learn to my android applications. For example this last week …

Optional Parameters in Kotlin

Last week I gave a talk on Kotlin at the Austin Droids/GDG Meetup Hosted at Evernote. After the talk a question came up about mixing and matching Java with Kotlin. If you aren’t familiar Kotlin is 100% compatible with Java, allowing you to mix and match both in your project. In particular the question was How are optional parameters treated …

Avoiding Inheritance Hell With Kotlin

I’d like to thank Matt Wear and Kirill Rakhman for their feedback on this post. I’ve many times found myself working on a project where a Fragment or an Activity has been over inherited. For example I was working a project one time that had something like the following:

Smaller APKs with Classy Shark

A big thanks to my friend Enrique López Mañas for giving me feedback on how to improve this post, and of course Boris Farber for creating Classy Shark. App Size An app I am working on feels a lot larger than it should be, my hunch that this is due to dependencies that are being included in the APK that …