Android

Continous integration on Android with travis CI

Testing is trending topic. At least, in my twitter timeline and the guys that I’m used to talk about Android with. This is a good thing because testing is mandatory in a serious project, but assuming that all of us have tests added we can benefit from this by using it often.

If you are developing using …

Development / personal

Sad code

I’m pretty sure that you have in the past read some pieces of code that are not well done, or, at least, you had that impression. When you are reading a fragment of code for the first time, it is sometimes hard to understand because you are not the developer who wrote it, maybe you …

Android / Architecture

Say goodbye to all main thread problems in MVP

Months ago I created a sample project demonstrating clean architecture in Android, you can see it here. One of the main problems when I created this project was the threading, in Android if you do too much work in the Ui thread you have drawing problems and your Ui can seem unresponsive while you keep …

Android / Architecture

Another approach to handle domain errors

Handling the internal domain errors as exceptions was a bad idea and I didn’t like since the beginning. For me an Exception must be thrown when there is no other choice, the method can’t deal with that action and the caller has any options to handle this, if the caller does not have any options why …

Android / Architecture

Modeling my Android domain layer

Since my last post about why I don’t use a pure repository pattern in Android I received some feedback and I want to explain how I organize my domain layer.

What should be my domain layer

Everything. No, seriously, everything that are decissions that your app makes in order to request data must be in this layer. …

Android

Compiling AOSP for your Nexus device on Mac OSX

Requirements

8GB of RAM, recommended 16GB
100 gb of free space on your drive

Preparing the environment

First we need a case-sensistive file system, so we need to create a sparseimage because by default the OSX system is not case-sensitive

hdiutil create -type SPARSE -fs ‘Case-sensitive Journaled HFS+’ -size 60g ~/android.dmg

If we want to resize this image later we can …

Android

City mapper coloured tabs and coordinator layout

City Mapper is one of the most known transport apps out there, personally I find it the best by far. Lately, they’ve changed their UI/UX which I find particularly useful and beautiful.

One of the widgets I like the most on the app are the coloured tabs, especially the colour changing progressively while you swipe …

Android

Retain & restore recycler view scroll position

If you come to a situation where you need to retain the scroll position of a recycler view (i.e. configuration change, going back on a certain flow), you might think that you have a retain and restore the scroll manually. Yes, in fact, you have to, but LayoutManager has a convenient API that makes things a bit …

Android / Architecture

Clean Contacts injectors are now proguard friendly

One of the awesome proguard features is the ability to strip the non-used code that you are packaging to the final apk, is really a nice feature because it removes a lot of size of our final apks and also strips the method number for the dex count (remember the 65k dex method limit)

The problem …