When creating the presentation and view logic of an app, principles such as DRY and composition might be overlooked. This can lead to us repeating ourselves and creating view models and layouts that are large and possibly hard to maintain.

DRY (Don’t Repeat Yourself) principle teaches us to avoid unnecessarily writing code that solves the same problem more than once. Thus, when put into practice, we can create small pieces of code that specialise at solving a specific problem.

With composition, we learn to the group the pieces of code that relate to a specific problem and use it as…

The data binding library has been around for quite some time, however not that many developers use it. One of the main reasons behind this lack of adoption is the belief that it results in untestable code. However, when used correctly it can actually make testing your code easier, while also adding to increased code reusability. In this article we will go through some examples to see how we can use data binding effectively to achieve this and what to avoid doing.

Separating View logic from Presentation logic

A common use case that we encounter on most projects is handling the visibility of a view. …

One of the biggest highlights of Google I/O 2019 was the announcement of a new UI Toolkit for Android named Compose. Inspired by frameworks like React, Litho, Flutter etc. it aims to accelerate the way UIs are built on Android by providing a declarative way of defining them, while leveraging the power of Kotlin and resulting in reusable components that are easier to build and maintain.

Some time has passed since Compose was announced, it’s still in very early stages (pre-alpha), but let’s have a bit of a look at what creating an Android app with it looks like and…

Chris Michael

Android Engineer at The App Business (London, UK)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store