1. Unit Tests and Concurrency

    Once Retrofit added RxJava support, RxJava became my go-to concurrency framework for writing Android apps. One of the great things about RxJava is the excellent testing support. It includes TestObserver, TestScheduler, RxJavaPlugins so you can switch your schedulers in tests. …


  2. Fragments, ViewBinding and memory leaks

    As an Android engineer one of the basic things you need to do is bind the views (written in XML) with Kotlin/Java code. You can do this with the basic primitive -findViewById(), using a library like ButterKnife, using a compiler plugin like Kotlin Android Extensions or starting with Android Studio/AGP 3.6 ViewBinding. There are a few other options out there but in my experience these are the most common. …


  3. Communicating with your Lifecycle Owner using RxJava

    Google introduced Jetpack, a family of opinionated libraries to make Android development easier a few years ago. One of the core classes in Jetpack is LiveData - an observable, lifecycle aware data holder. The typical use case is having a ViewModel that exposes LiveData as a property, and observing it from your lifecycle owner, a Fragment or an Activity. …


  4. Side Effects and Composition

    Photo by Ryan Yoo on Unsplash …


  5. Functional Hangman in Kotlin with Arrow (part 2)

    Converting a Functional Hangman game from Scala (ZIO) to Kotlin (with Arrow) was a nice exercise. I enjoyed working on it and I learned a lot. When I asked for feedback on the #arrow channel, one of the maintainers, Leandro had an interesting suggestion. Instead of hard-coding the data type IO I should try and make the program polymorphic and use Kind instead. That means writing the code focusing on the domain logic, using abstractions, and deferring the decision for the concrete data type like IO or Single (from RxJava) until the main function. …


  6. Functional Hangman in Kotlin with Arrow

    A few days ago I run into this blog post about implementing a console Hangman game using Scala ZIO. The blog post is based on this talk delivered by John De Goes, for the Scala Kyiv meetup, where he codes a console Hangman game using functional programming. …


  7. Setting up GitLab CI for Android Projects

    My first experience with continuous integration was using Bitbucket in combination with Jenkins. I was pretty happy with my setup. Jenkins would run on every commit making sure my code compiles, run android lint and run my unit tests. I also set up continuous deployment using Fabric. …


  8. Contributing to OSS for Hacktoberfest

    Digital Ocean in partnership with Github are organizing the fourth Hacktoberfest event this October. If you make four pull requests between October 1 and October 31 to any Github hosted repository you get a Hacktoberfest T-shirt. This year I decided to take part and I already made two pull requests. …


  9. My First Unit Test

    There are different reasons developers write tests. Some of them are: …


  10. Converting a TODO app to Kotlin (part 3 - the Model Layer)

    In part 2 I wrote about converting the Task class from Java to Kotlin. The number of constructors went from four down to two thanks to default parameters. The boring assignments in the constructors are gone thanks to properties. I also mentioned data classes and using if as an expression. …