My little software warehouse

2018

Oct 26

A new chapter

It’s been a while It’s more than a year since my last blogpost which incidentally (or not) it happened right a month before the birth of my second child. In the past year I lost a lot of sleep, and now I am kind of getting back to normality (which means new side gigs :-)). My interests moved from Android and mobile in general to Go and distributed systems, which is what I am probably …

more

2017

Apr 30

Android okhttp and websockets

Websockets Rest http calls are the most common interaction between Android apps and remote servers. However, there are some scenarios where the interaction is better handled via a persistent connection: think about a chat, or a multiplayer game where data flows in both directions and the server needs to push data to the clients and to be aware of which client are connected. This kind of scenario …

more

2016

Aug 27

Android mvp testing

MVP is Model View Presenter .. which is a pattern that is very popular among Android developers nowdays. I don’t intend to write (yet) another guide about MVP in Android, because others have done a better job, for example: Antonio Leiva’s introduction to MVP Hannes Dorfmann’s introduction to Mosby Fernando Cejas’ post on clean architecture A lot have been said about MVP …

more

Jun 20

How to a timer

Ok, I must confess the title is built to draw people’s attention, because you know, nowdays everything is done in a reactive fashion. RxJava is superhelpful, but if we forget the ecosystem our apps are running into, we risk to forget the proper way to implement certain tasks in Android. Why do we need a whole post about timers? Recently, I had to implement a countdown timer in Android. If …

more

Apr 20

Happines is relative

Using relative layout is bad .. or at least they say so. The truth is, it is relatively easy to build complex layouts using RelativeLayouts, but this ease of use comes with a cost: in order to provide that kind of flexibility, RelativeLayout does two measurement passes. There are a lot of talks and posts explaining that if you have nested relative layouts, you’ll end up with many measurement …

more

Jan 1

Cached rest requests with rxjava

Disclaimer: In this post I am trying to cover a proper approach to a common problem. I am still in the process of wrapping my head around RxJava so what I write here might not be the best way to solve the problem. Cached requests with RxJava Lately I’ve been trying to develop a rest backed app using RxJava. I must admit that once you get in the proper mental mood, RxJava almost feels like …

more

2015

Sep 13

Testing rxjava observables subscriptions

Testing RxJava While catching up with the latest Android novelties I could not ignore RxJava, which seems to grow in popularity between android developers. If you just heard about it, and you want to get your feet wet, I really recommend Dan Lew’s Grokking with RxJava series as a starting point. RxJava is asynchronous by nature, so unit testing it might seem a daunting at first, especially …

more

Sep 5

Mocking with robolectric and dagger 2

Why robolectric I’ve been a fan of robolectric since the old days, since when Android Studio was not an option and few developers embraced IntelliJ. I left it a bit behind after the introduction of Android Studio, since its support was far from optimal. Things have changed, and after listening Corey Latislaw advocating its usage during this fragmented podcast episode I wanted to give it a …

more

Sep 4

Its been a while

.. since my last blogpost. I’ve done a few things in the meanwhile, I wrote a game with LibGdx, I tinkered with various frameworks, but on top of all these things I’ve been taking care of my one (and a half) year old daughter. I do certainly have less time to devote to side projects, but I still like to learn new things and Android is exciting from that point of view.

more

2014

Sep 1

Dragging with viewdraghelper

While working on my last side gig, a patch to Firefox for Android to allow the urlbar to be dragged in order to show content hidden behind the main view, I had to deal with ViewDragHelper and understand how it works. The final result (please note that the patch is still under review) is something like this: It caused me more than one headache, and for this reason I am writing this post hoping it …

more