Articles

Vibe Coding, Kotlin, Finance, and Data Visualization

Vibe Coding, Kotlin, Finance, and Data Visualization

Recently, I came across a paper discussing an experiment and tried to reproduce it. Here’s a brief summary: - Portfolio A: In a bull market, grows by 20%; in a bear market, drops by 20%. - Portfolio B: In a bull market, grows by 25%; in a bear market, drops by 35%. - Bull market probability: 75%. According to the paper, both portfolios should have a one-year expected return of 10%.
Treat life like a marathon, not like a sprint

Treat life like a marathon, not like a sprint

Like most of us, I am daily flooded with thoughts about life, my objective position in it, whether I am missing anything, or whether I need to do better. Am I providing enough for my family? Is my career on track? Am I being healthy enough? Am I just passing through life instead of aiming to strive? Those thoughts have been slowly mitigated, but they never got away. Over time, I have been slowly accepting this reality, and I came to realise that all the marathon training and long-distance running have helped me come to terms with these facts.
Uploading SARIF Reports to GitHub

Uploading SARIF Reports to GitHub

Recently I wanted to add Lint reports to a repository on GitHub. The goal is to report potential Lint violations when new code is committed, to make sure that all the committed code is lint-warning-free and pretty. My first idea was to look for a GitHub action that could run ./gradlew lint and report it as a PR comment. After asking about ideas in the Android Study Group, Carter Jernigan and Justin Brooks suggested me to upload directly the SARIF files into GitHub.
KotlinConf 2024 announcements

KotlinConf 2024 announcements

The first day of the KotlinConf 2024 is over, and there has been a significant amount. After 5 years the conference happened again at The Bella Center in Copenhagen, a fantastic venue close to the historical center of the Danish capital. The last two weeks have been intense, with the Google I/O announcing another set of relevant features for Android and Kotlin developers. Most notably, Google is now supporting KMP for Android development.
HTTP chunk requests with Android and ktor

HTTP chunk requests with Android and ktor

In this very short article, I will explain briefly what is a chunk or streamed HTTP request, what are the benefits of using it, and how it works in Android. Android apps use HTTP requests to download data from a backend. This information is stored and processed on the app to make it functional. HTTP requests are executed using different frameworks on Android. The most common ones are Retrofit or OkHttp.
My Investing Summary of 2022

My Investing Summary of 2022

Another solar rotation passed, and the world experienced a plethora of unexpected events. In the aftermath of the Corona epidemic that altered the course of the last couple of years, we had the unfortunate invasion of Ukraine by Russian forces, the tightening of Corona measures in China (and toward the end of the year, their withdrawal and gradual reopening of the economy), an ongoing economic recession, the rate hike by the FED and the general uncertainty of the most immediate future.
KMP, iOS Developers and Production

KMP, iOS Developers and Production

Kotlin Multiplatform (or KMP, KMM Mobile, etc) has been widely used for a number of years in applications that are currently in production. JetBrains compiled a website listing some of the companies that are currently using KMP. Since the advent of the mobile platforms we enjoy today, there has always been a certain market interest to push multiplatform technologies, such as Cordova, Xamarin, and others. With more or less success, those technologies aimed to provide a unified framework to develop multiple codebases, mostly focusing on the aspect of pricing (create code once, deploy multiple times).
A recapitulation of investing in pandemic times

A recapitulation of investing in pandemic times

It has been around 14 months since the pandemic started. We have all been affected by it to a greater or lesser degree, and the investing world has not been an exception (although surprisingly, the stock market is one of the winners of the pandemic). In this post I will share how the pandemic changed my investment thesis, the things I learned, and the mistakes I did. 14 months into the crisis of our generation (and with a few months to recover whatever the new normal will be), we now know that things will never be the way they used to be.
A short story of randomness (I)

A short story of randomness (I)

I have always been fascinated by the above comic strip. A discussion on randomness and determinism becomes as much a philosophical issue as it is a practical one. They are used in a variety of applications: from the obvious cryptography, gaming or gambling to the less evident politics or arts. How can we be sure that a number is random? Will observing the process mine our efforts on generating the random number, similar to the observation of a cat inside a box with a decaying radioactive atom?
From Java to Kotlin and back (III): Calling Java from Kotlin

From Java to Kotlin and back (III): Calling Java from Kotlin

This article is part of a series. You can find the remaining article of the series here: From Java to Kotlin and back (I) — Calling Kotlin from Java From Java to Kotlin and back (II): Calling Kotlin from Java In this last chapter of the series, we will evaluate consideration when calling Java code from Kotlin. One could argue that even in this situation happens often, keeping considerations in mind for some code that might legacy is not that practical.
From Java to Kotlin and back (II): Calling Kotlin from Java

From Java to Kotlin and back (II): Calling Kotlin from Java

This article is part of a series. You can find the remaining article of the series here: From Java to Kotlin and back (II): Calling Kotlin from Java From Java to Kotlin and back (III): Calling Java from Kotlin In the previous article, we explored how Java and Kotlin can interact with each other, and some considerations in this regard. In this second edition, we will keep reflecting on some relevant aspects to consider when Java is calling Kotlin.
From Java to Kotlin and back (I): Java calling Kotlin

From Java to Kotlin and back (I): Java calling Kotlin

This article is part of a series. You can find the remaining article of the series here: From Java to Kotlin and back (II): Calling Kotlin from Java From Java to Kotlin and back (III): Calling Java from Kotlin I am currently working on a multi-module project that combines a variety of Java and Kotlin code, so I decided to publish my thought and notes as an article series. It will likely help me as a journaling practice, and hopefully can help other potential readers that end up here trying to find some tips while they are facing the same problem.
Considerations when creating Android libraries

Considerations when creating Android libraries

If you are an Android developer, chances are you might have been working on your own Android libraries. A library is a useful way to create a reusable set of features that need to be integrated through different apps (or even different libraries). A library is a self-contained package including code and resources required to execute some functionality. Importing a library in our Android app is the same process as importing a .
GitHub Actions for Android developers

GitHub Actions for Android developers

If you are developing Android apps, chances are you have confronted any sort of CI at some point in your career. If you thought Android fragmentation was a thing, the wide availability of CI systems will be familiar to you. GitHub Actions was released around November 2019, and since then it has proved itself to be reliable for a production environment (one of our requirements before committing to any software system).
Using the Signature class to verify data

Using the Signature class to verify data

When there is an exchange of information happening, we often want to verify that the origin of the data is the right one. This can be used to ensure that the right clients are having access to our resources. For instance, let’s imagine that we want to ensure that an authorized device is querying a file with sensitive information from our backend. An immediate solution could be to use a X-Api-Token in our device.
Managing the Kotlin Weekly

Managing the Kotlin Weekly

I just sent the issue #182 of the Kotlin Weekly. #182 means that this has been the week 182 that the Kotlin Weekly is alive. Many things have changed since the first edition on the 7th of August 2017, sent to over 200 initial subscribers with 5 articles. In some of the first editions, the content was so scarce that I ended up writing my own articles to include them, or adding some code snippets I posted on Twitter.
2019 in retrospective

2019 in retrospective

This year is over. During the last 365 days, I fulfilled some of the goals I meticulously established at the beginning of the year. In other goals, I failed without palliatives or anesthesia. During the last 9 years, I have been following a process to determine my goals for the upcoming solar rotation. I sit at a coffee place next to my home in Munich, order a ginger tea and take notes.
A Gentle Introduction to Investing for Software Engineers (IV) — My methodology to determine which…

A Gentle Introduction to Investing for Software Engineers (IV) — My methodology to determine which…

You can access all the articles of the series through the following links: (I) — Motivation (II) — Compounding interest and introducing other factors (III) — Determining a company value and acquisition point (IV) — My methodology to determine which stock to buy In this fourth and last article of the series, I will explain my methodology to acquire individual stock in the market. Most of the guidelines I expose are thought of as a guideline that you might need to adapt depending on your circumstances (for instance, the double taxation will play a role depending on your tax residence).
Re-post: Which city has the most intense Android scene in Europe?

Re-post: Which city has the most intense Android scene in Europe?

I wrote this post originally 5 years ago. For a side project, I had to use the StackExchange data explorer again, so I decided to revisit it and update the numbers. StackExchange Data Explorer is an open-source tool to run SQL queries against public data from StackOverflow. Since StackOverflow is the biggest development forum of the world, there is surely a lot of information that companies can actually retrieve from their system in order to take some business decision (this is actually a brilliant place to apply BigData)
Using Git Hooks to improve your development workflow

Using Git Hooks to improve your development workflow

Recently, I was contributing for the first time to a new codebase. I extended and implemented some functionality that I needed. After thorough testing on my machine, where I checked that the functionality was properly working, I committed my contribution. Minutes after, our CI environment delivered a message: 4 Tests failed This happens so often, even on the codebases we are used to work with. We tend to focus on developing the new features, and forget that there is a test that is covering them.
A Gentle Introduction to Investing for Software Engineers (III) —Determining a company value and…

A Gentle Introduction to Investing for Software Engineers (III) —Determining a company value and…

You can access all the articles of the series through the following links: (I) — Motivation (II) — Compounding interest and introducing other factors (III) — Determining a company value and acquisition point (IV) — My methodology to determine which stock to buy In this third article of the series, I am giving an introduction to some of the factors that we commonly use to determine whether a company is apt for our investment strategy, whether it is the right moment to acquire stock, and in general to provide us some insight beneath the numbers.
A Gentle Introduction to Investing for Software Engineers (II) — Compounding interest and…

A Gentle Introduction to Investing for Software Engineers (II) — Compounding interest and…

You can access all the articles of the series through the following links: (I) — Motivation (II) — Compounding interest and introducing other factors (III) — Determining a company value and acquisition point (IV) — My methodology to determine which stock to buy In this second article of the series, I want to keep exploring some metrics to show the evolution of our investment keeping in mind different scenarios. This time I will be including screenshots from a Google Spreadsheet instead of displaying text tables.
A Gentle Introduction to Investing for Software Engineers (I) — Motivation

A Gentle Introduction to Investing for Software Engineers (I) — Motivation

You can access all the articles of the series through the following links: (I) — Motivation (II) — Compounding interest and introducing other factors (III) — Determining a company value and acquisition point (IV) — My methodology to determine which stock to buy If you are reading this article, chances are you a Software Engineer that has ended up here looking up for saving, investment or retirement advice. Or maybe you have a different profession, but ended up here anyway.
Approaching a methodology to select speakers for conferences

Approaching a methodology to select speakers for conferences

After a great first edition, this year I organised the second edition of the Droidcon Vietnam with some local folks. Before I organised a conference like this, my experience was limited to local Meetups in Munich (I am currently the organiser of the Kotlin User Group Munich, and the Firebase User Group Munich). The latter has a different nature in terms of resources, logistics and efforts required. They are community-based events, local and — without requiring an easy trajectory — they are certainly less complex than the former.
Creating a library for Android: The Good, the Bad and the Ugly

Creating a library for Android: The Good, the Bad and the Ugly

Software Development is like an Ouroboros. You end up going to the place you have previously resided, with requirements and knowledge updated and refashioned. You might have started working on an initial prototype that began the journey as a basic HelloWorld, and it has evolved into one of those mythological Nordic monsters. Or maybe Greek monsters are more terrifying and frightening. I do not know. At one of my projects we recently came up with the requirement of extracting some of the functionality well buried there to expose to third-party consumers.
On Strategies to apply Kotlin to existing Java code

On Strategies to apply Kotlin to existing Java code

Since the latest announcement at the Google I/O, things have been crazy. At the Kotlin Weekly Mail List we had an increase in subscribers over 20% in the last two weeks, over 200% increase in article submissions, and at a Meetup I organise (Kotlin Users Group Munich) we had a huge increase in attendees. And all this combined with the general blast in the developers community. A trend that will only continue to grow.
A follow-up on how to store tokens securely in Android

A follow-up on how to store tokens securely in Android

As a prologue to this article, I want to remark a short sentence for the notional reader. This quote will be important as we move forward. Absolute security does not exist. Security is a set of measures, being piled up and combined, trying to slow down the inevitable. Almost three years ago, I wrote a post giving some ideas to protect String tokens from a hypothetical attacker decompiling our Android application.
Using Firebase as a Real Time System

Using Firebase as a Real Time System

I was captivated by exposed pictures since I was a child. Is a unique way to capture movement in a static image. I have been an avid user of Firebase since more than a year now. When Parse.com announced it would be shutting off, I was attending a Google Launchpad in Mountain View as a mentor. If you haven’t heard of the Google Launchpads, they are great. Not only for the startups, which get a fair amount of advising and mentoring from people in different fields (UX, Tech, Marketing, Monetizing and Fund raising…) but also for mentors itself!
Learning to use and abuse Mutability

Learning to use and abuse Mutability

I am an old Java man, I never allocated many of my thoughts to reflect on the philosophy of mutability. In Java, unlike in other languages, there is no precise control over what is mutable and immutable. I never thought of Java objects as having this feature. Instead, I would always refer to them as “that Java class that has no setter”. “That Java class that cannot be modified once the value has been set up”.
An Overview of Polls for (Android) (Mobile) Developers in 2016

An Overview of Polls for (Android) (Mobile) Developers in 2016

Last year I started a weekly routine consisting on posting on my Twitter a poll every Monday, with topics related to Android / Mobile / Software Engineering (in that order). It has been a total of 18 polls during the year, with an overwhelming response and engagement of the community. (On a side note, I can‘t stress enough how lucky I am of being able to be a part of the Worldwide Android District.
On properly using volatile and synchronized

On properly using volatile and synchronized

In the last weeks I have been writing about the transient modifier and the different types of references available in Java. I want to hold the topic of underused/misused topics in Java and bring you this week the volatile and synchronized modifiers . Multithreading is an entire discipline that takes years to master and properly understand. We will keep a short introduction in this article. In computing, a resource can be accessed from different threads concurrently.
Diving deeper into the Java transient modifier

Diving deeper into the Java transient modifier

Nothing is tied forever. Neither are transient variables. Last week I published an article to help you understand how references do work in Java. It had a great acceptance, and I got a lot of constructive feedback. That is why I love the software community. Today I want to present you another article diving into a topic that it is not widely used: the transient modifier. Personally, when I started using it I recall I was able to quickly grasp the theoretical aspect of it, although applying was a question of a different nature.
Finally understanding how references work in Android and Java

Finally understanding how references work in Android and Java

A few weeks ago I attended Mobiconf, one of the best conferences for Mobile Developers I had the pleasure to attend in Poland. During his eclectic presentation “The best (good) practices”, my friend and colleague Jorge Barroso came up with a statement that made me reflect after hearing it: If you are an Android developer and you do not use WeakReferences, you have a problem. On an example of good timing, a couple of months ago I did publish my last book, “Android High Performance”, co-authored with Diego Grancini.
You live in a better world today

You live in a better world today

This has been a very tragic week in Germany. In less than five days, four attacks happened in the southern provinces of Bayern and Baden-Württemberg (the motivation of some of them being disputed, but being mostly assigned to the refugee crisis and open-borders policy of Merkel). After the attacks followed the classical harangue from certain civil and political sectors drawing attention on the rapidly deteriorating social peace in Germany and Europe.
The theoretical animal

The theoretical animal

We are theoretical animals. We spend our entire lives analyzing our immediate environment, theorising on how to solve our most immediate problems or improve processes. We think of having conversations with beloved people, we think of carrying out actions we have planned for a while with relatives and friends, and we think of starting new projects. Yet we do little to implement them and put all this knowledge into practice.
A Comprehensive Introduction to Perform an Efficient Android Code Review

A Comprehensive Introduction to Perform an Efficient Android Code Review

You are working in a team that cares about code quality. You have been doing -or thinking of doing- some code pairing. Your team regularly carry out hacking events to talk and present new technologies, or to talk about the personal discoveries of each member. And you are trying to devise the perfect code review process for your organisation. Is this situation familiar to you? Code reviews are hard to implement.
Automating Android development

Automating Android development

I have been recently talking at the DroidCon Spain and DroidCon Italy about how to automate a traditional Android workflow. To my surprise, there are still many organisations that do lack a Continuous Integration (CI) strategy. This is a big mistake! I decided to put down in words my thoughts about how to efficiently implement CI. As a software engineer, your aim is to automate as many processes as possible. Machines are more efficient than people: they do not need food neither sleep, they perform tasks errorless and they make your life easier.
Event-driven programming for Android (part III)

Event-driven programming for Android (part III)

(This is the third article in a three-part series) Previously, I have given an introduction to Event Driven programming with Android, and show some code to create a HelloWorld Event-Driven application. Now we are likely facing another problem: how can we easily scale an application using Event-Driven development without falling into a messy and unorganised code? In this article, I will provide a proposal architecture that serves to scale an application based on Event-Driven development, but that can also be used to create a more general type of applications.
Event-driven programming for Android (part II)

Event-driven programming for Android (part II)

(This is the second article in a three-part series) In the previous article we had a short introduction into Event-Driven programming. Now let’s see some actual code and how to perform the basics with EventBus. First I will present the entities that play a central role in Event-Driven programming. Refer to the following image taken from the EventBus repository. An Event Bus. This is the central communication channel that connects all the other entities.
Event-driven programming for Android (part I)

Event-driven programming for Android (part I)

(This is the first article in a three-part series) Although Android includes some event-driven features in its development, it is far away from being a pure event-driven architecture. Is this something good or bad? As in every issue with software development the answer is not easy: it depends. First, let’s establish a definition for event-driven development. This is a programming paradigm where the flow of execution is determined by events triggered by actions (such user interaction, messaging from other threads, etc).

A Comprehensive Introduction to Perform an Efficient Android Code Review

Planted December 9, 2015
Pruned June 9, 2025

A Comprehensive Introduction to Perform an Efficient Android Code Review

You are working in a team that cares about code quality. You have been doing -or thinking of doing- some code pairing. Your team regularly carry out hacking events to talk and present new technologies, or to talk about the personal discoveries of each member. And you are trying to devise the perfect code review process for your organisation. Is this situation familiar to you?

Code reviews are hard to implement. A team is composed of N people, each of them having its own agenda and priorities. Some people might be more perfectionist and might have a different acceptance criteria for the code reviews. Some others truly believe the reviews should be something at the top of each new feature or fix, and completely voluntary. As in any team, convincing needs to be done rather than imposing.

What is the purpose of a code review?

After a few years applying it (and more specially, comparing it with the time I did not use them) I can only think of code reviews in positive terms. If they are properly implemented, there is no single disadvantage about them, and is all about benefits. This is a cheat list I once wrote to convince other team members of why should we apply code reviews:

  • Education of other developers: software systems are complex. You will likely be working in extensive platforms knowing a 5%, maybe a 10% of the total global. You do not know what is going on in the other side, and this is a big limitation. Time is limited and pressure is normally vast enough to stop you from free-wandering around other modules. A code review can introduce you here the other part of the platforms without taking a significative amount of time — and yes, this is an amazing introductory method for new members in a team. Code reviews are a tool for knowledge transfer.
  • Improving code quality: programming puts you in a mental flow where you isolate from external influences and focus on a single target. It makes you biased, since you are thinking “how do I make this work?”. An external developer will think “how can I break this, and where can I find weak points?”. This is the reason why developers should never test their code, and also why we have specialized QA testers. Introducing a third person to review will very likely find bugs that otherwise will go unnoticed.
  • Creating a developing culture: we all have work with coding guidelines and style. We all have our own oddities and crazes we have acquired during years of development, but in an organisation we want to make all fit in the same developing culture. “But what happens with our team creativity!” I have heard many times when exposing this argument. There is a Japanese proverb, 出る釘は打たれる, “A nail that sticks out will be hammered”. We do not need to hammer any nail here. We can take the finest from the Western and Eastern philosophies to create a radically cool process, taking the best of each world.
  • Confidence: if you are working alone, you are coding for yourself. You do not care if the code is readable by another person and this will in detriment of your quality. A person should never work alone in any team: he/she will burn out, the quality of the code will decline and the project will perish). If you know a third person will read and analyse your code, your inner-code will put an extra effort to make it clear, concise and readable. Is like a very cheap tool for static code analysis.

How a code review should be done for Android?

Those are general reasons and arguments to support code reviews, but you have read at the beginning of this article in the title the word Android. So how can we efficiently review Android code? Well, there a few tools and techniques that we can specially apply in our green platform.

Disclaimer/50% spam: I wrote some time ago an article on automating Android development, providing a model for branching and committing to a Git repository. Adopting a branching and development model is crucial in order to implement a code review process. All the code reviews must be done before a branch is actually merged into another one. In my particular model, the code reviews are done in the following sections:

  • When a feature has been finished, and needs to be merged into alpha.
  • When a bug has been discovered during the bug fixing sprint, and needs to be merged into beta/alpha.
  • When a hotfix has been finished, and needs to be merged again. image In the model proposed in the previous post, this is where you apply the code reviews

UPDATE: My colleague Nick Skelton, who presented this topic with me in different conferences, posted also his own article with ideas and a further extension of the model. I can totally recommend to check it out.

Getting started

First of all, this is a model I have used in my previous company and now as an independent contractor. It worked for me. It specially worked when it comes to Android development. But do not forget that there is nothing dogmatic in Software Engineering. Theories must be adapted to each scenario, so take what you like from here and feel free to modify it.

When I have a branch in one of three previously mentioned cased that needs to be merged, I open a Pull Request and assign at least one (and preferably two) other developers to check the code. Inexplicably, some environments only allow one reviewer per PR (Good morning GitHub!), so this process needs to be done manually (when reviewer A is finished, he should assign the review to the reviewer B). Optimally one reviewer must be from the development team (they are aware of restrictions and status of the project), and the second one will be from an alien team (we want to share knowledge with this individual).

Reviewers have veto power. They both need to agree on merging the branch. This arises team spirit, since everybody is a little bit responsive of each feature being committed into our system, even if they are not direct contributors. When there are disagreements they need to be argued and solved in our PR Dashboard, until we reach a consensus. If a referee figure is absolutely required, the Team Lead or a similar figure should have a decision power — although in all my years of experience, I never had a problem with a PR being blocked due to lack of agreement of brilliant jerks!

A proper PR starts with downloading locally the branch and compiling it in our emulator or device. Why is this required? Well, Android is a fragmented platform with a rich ecosystem of plugins and versions. 99% of these problems can be avoided by reproducing the environment on a different computer and device/emulator.

I also advocate for an informal test of the new feature or bug. Due to our acquired bias we tend to miss trivial points while we develop because we focus on our functionality. Another big percentage of errors can be detected by this simple step: asking for the functional requirements and test that the application follows them.

To connect Functional Requirements with branches and PR easily, is a good strategy to name our branches as our issue ticket (for instance, PROJECT-123). Most of the environments allow us to connect a PR with the Ticket repository containing description of the ticket and functional requirements, so is less of a hassle for the reviewer to access it fast.

When should we do them?

We should avoid interruptions. Unless it is a Hotfix, I normally do code reviews after my lunch break, or I start during a Pomodoro break. That way I ensure they do not interfere with my own development, but is done in a more relaxed moment.

A code review should also not take more than 30 minutes, but this is heavily connected to how granular the features you are implementing are. If you find yourself continuously busy for more than 30 minutes doing code reviews, is a good moment to talk with your project manager and discuss whether the dimension of the features you are implementing is adequate or not.

Code analysis

So we have the feature in our computer. It has compiled, it meets the functional requirements and now we have to start analyzing the code. Where can we start? Which questions can we ask to the code?

Architecture patterns

  • Is this code following our architectural pattern? MVP, MVC, MVVM, Event-Bus?
  • Is there any operation being performed in a wrong class? (i.e., data logic in a Fragment)

Testing

  • Is there a test created for the feature or bug? Have the previous tests being updated?
  • Are there all the tests types implemented? Unit tests, integration tests and UI tests.
  • Are the new tests currently working?

Static Code analysis

One of my favorites! In Android we can use Lint to make an static analysis of our source code. Some of those comments might make sense, and some other not (for instance, I get a lot of warnings of “spelling mistakes”… because I mainly work with German teams that tend to use German names, leading to variable names such as datenbankVerbindung. If you have legacy code and no resources for a refactor you might want to disable the warnings for deprecation.

As a rule of thumb: I apply Lint in all the new added files and the previous modified files. I do manually check that the Lint warnings make sense, and notify when they do and the code can be improved.

Lint can be very handy. It notifies possible bugs and memory leaks. It also notifies of deprecated code, style issues and naming conventions. It can be a powerful educational tool.

Code styling

Every organisation should have a coding guideline of its own (and if you do not have one, is time for you to start defining one). During my time working at Sixt we open-sourced our coding guidelines. Android has some coding guidelines for contributors that you can use as an inspiration for your own ones. And of course, the Clean Code bible has an extensive set of recommendations on clean coding and code styling — a must book if you have not read it yet.

Automation baby!

From the previous steps, a few ones can be very easily automated. Lint can be easily set up in Jenkins to be executed with each build. We first need to install the Lint plugin in our Jenkins CI server. Then we just need to activate it in our job configuration:

image Now we are applying and saving our Lint results!

As a useful rule, you should deactivate Lint in your Gradle file to prevent the application from stop building. This can be easily done with the following code snippet: `android {
// …

lintOptions {  
    // Don't abort if Lint finds an error, otherwise the Jenkins build  
    // will be marked as failed, and Jenkins won't analyse the Lint output  
    abortOnError false  
}  

}`

I prefer to mark Lint builds as unstable rather than failed, and to check the output manually (again, this will depend on your company policies). Jenkins can even be set up to run Lint when a PR is open! I can’t stop saying how much using Jenkins makes the life of everybody at the office easier, but I am still surprised how many people is still not using it — my random guess after asking it at many conferences is probably a third of the companies.

Coding Guidelines and styling can also be automatically checked in Android. You can use Checkstyle (a development tool to ensure that a coding style is being fulfilled) and run it against your code. Checkstyle has plugins for Android Studio, Jenkins and definitely other platforms. Depends on the strictness you follow you might want to make the build fail or mark it as unstable. I personally like sending an automatic report to the committer mentioning the flaws in its coding style.

Conclusions

Performing a code review is like cooking: is a personal process where only a main guidelines must be followed, and the final procedure tend to branch and differ from the initial seed. However, after reading this post you should have a more clear idea on how to start and how to check-and likewise, if you are an experienced developer I hope you were able to get a few ideas an inspirations.

There are a few more points I would like to remark before finishing the article:

  • Code reviews are about the code, not about the person. This must be a clear point to each team member, to avoid taking it personally. The purpose is to ship a high-quality code, not to increase ego.
  • Good things must also be pointed out. When I find something clever or brilliant, I learn from it and I let it know to the developer.

I always think that live demos are way better than a theoretical post, so I plan to post a few more articles with particular ideas and code reviews. If you are interested in the topic, feel free to subscribe or to follow me on Twitter! If you like the article, click on the little heart at the bottom to recommend it and feel free to share it :-)

Thanks Corey Latislaw for your feedback, you rock!