Android / Architecture

Modeling my presentation layer

After modeling my domain layer here it comes, modeling my presentation layer. The reason for this post is that I saw in many projects that are moving from a legacy codebase to an MVP approach that there are some issues trying to differentiate what belongs to the presentation layer and what belongs to the UI …

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 …

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 / Development

Create a mapper easily

If you are used to implement clean architecture in your project you will know that the mappers are a very boring part to write. The mappers are needed to send data across boundaries and you need to be careful while you are writing it, because if you forget to map any field the data will …

Android

Playing with the new support TabLayout

Today I had to implement the new TabLayout from the support library and this is my Tips&Tricks to implement the tabs in a painless way.

The default tab indicator is so thin and can’t be appreciated it if the background is similar to the indicator. The first thing to change is the tab indicator height by …