Photo by aisvri on Unsplash

Today I am going to write about something I came across recently: making some already existing code thread-safe.

What does thread-safe mean? 🤓

Looking on Google we can find many similar definitions:

Thread-safety or thread-safe code in Java refers to code which can safely be used or shared in concurrent or multi-threading environment and they will behave as expected. any code, class, or object which can behave differently from its contract on the concurrent environment is not thread-safe.

So, to put it simply, a piece of code can be defined as thread-safe if is warranted that executing it concurrently or in multiple threads is going…

Photo by Dmitrii Vaccinium on Unsplash

Today we are going to explore how to deliver both feature and regular test builds through the Google Play Store.
It is true there are many tools available for this purpose: Firebase App distribution, Visual Studio App Center, etc. but here we want to focus on the Google Play Store.

The main advantages are:

  • You are probably already distributing your app through that store, therefore you don’t need to introduce an extra tool
  • Automatic updates for testers (like it happens with usual production builds)
  • Is easily integrable with most CIs, especially in combination with the Gradle Play Publisher plugin
  • Is…

Image of programming code
Image of programming code

Setting up spotless is quite easy, let’s take a look at what we did at Collect by WeTransfer to have a setup that is as much ready-to-go as possible.

🔍 What is spotless?

Is a code formatter: we can define rules and it will apply them every time we execute it.

It’s pretty useful in automating fixes for pretty simple (and common) formatting mistakes as in spaces, newlines, removing unnecessary imports, etc.

You can find more info at

🛠 Setup

The setup is pretty simple (you can follow the instructions in the GitHub repo as well): add the necessary dependencies, install ktlint on your machine…

If you go to the website and check for the snackbar designs, you will see new something like this:

Which is something a bit different to what we used to have before:

Recently I found myself in the situation of coping files of (potentially) any size, so I started in a simple way.

The simple way means just reading the bytes of the file and writing them into a new one, so starting with the file to copy we could simply do something like this:

Before Android 10

In the past in order to save content, let’s say an image, on a device from our app and make it publicly available to all the apps installed on that device we could just do:

We always struggled a bit in finding a nice way of automatically generating release notes for our Android project: we first started writing them manually, then using the first commit message of every PR, but it wasn’t really working.

Finally, I found a way to use PR titles, which are usually way more descriptive and useful to an eventual tester than, for example, commit messages.

I am going to share here our final setup.

Note: We are using Bitrise, but this should work with any similar tool since the main logic is done in bash scripts :)

Setup “Release Drafter”

I ran into this issue recently, and I found very little documentation (most of which was out of date) so I decided to write a pretty simple step by step tutorial.

First of all, let’s start with a small introduction on what is an Instrumented test. Quoting Google official docs:

Instrumented unit tests are tests that run on physical devices and emulators, and they can take advantage of the Android framework APIs and supporting APIs, such as AndroidX Test.

A great advantage of unit tests is that you can test real instances of your classes (without mocking them), or you…

Alessandro Mautone

Senior Android Engineer @WeTransfer 🤖 🇻🇪🇮🇹 Paraglider, Runner, Kayaker.

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