Today I am going to write about something I came across recently: making some already existing code thread-safe.
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…
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:
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.
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 https://github.com/diffplug/spotles
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
material.io 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:
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 :)
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…
Senior Android Engineer @WeTransfer 🤖 🇻🇪🇮🇹 Paraglider, Runner, Kayaker.