It has been a year, which means it is once again time to re-examine our TODO Lint rule . TL;DR: The rule checks if a TODO includes mandatory information โ an assignee and a date. We have also explored providing alternatives when suggesting quick fixes: A Lint rule with alternative fixes Today we will add another feature: enforcing the Lint rule in test files. Say we have this test file with an inv
2 Dec 2025An Android Love Affair
Latest posts
In my previous post , we updated our TODO Detector to be more flexible. It is also easily extensible so that if we want to include more parameters or perhaps add more checks, we can follow the existing pattern and modify it. For example, what if instead of the date being in parentheses, we want a reference to a JIRA ticket or a GitHub issue instead. Furthermore, what if we want to restrict these i
24 Jul 2024A few years ago, I wrote about writing a Lint rule to validate the format of TODO comments. Whilst I find that Lint is still difficult to grok, I have since learnt a little bit more that I feel a revisit of this rule is warranted. To recap, the rule enforces that all TODO s must follow the format: // TODO-[ASSIGNEE] (DATE_TODAY): Some comments The RegEx to check if a TODO is valid or not is a bit
22 Jul 2024Being a perpetual RegEx n00b, one thing I keep on forgetting is that it is easy to get tripped up when extracting information from an input. I always forget that looking for a match does not really just give back just the matching values โ they are instead contained in Group s. Matches and Groups and all the things ๐ For example, given the sentence โWelcome to zarah.dev!โ, the value โzarah.devโ ca
21 Jul 2024Last year, I wrote about an extended adb script. The idea of the script is to make it really easy to issue an adb command even if there are multiple devices attached by presenting a chooser. For example, if I have two physical devices and an emulator and I want to use my deeplink alias , I get presented with a device chooser: โ ~ deeplink https://zarah.dev Multiple devices found: 1 - R5CR7039LBJ 2
2 Feb 2024A few weeks ago, I wrote about a script for making adb a little bit more interactive. The script makes the process of running an adb command much smoother if there are multiple devices attached by presenting a chooser. For example, when sending a deeplink: โ ~ deeplink https://zarah.dev Multiple devices found: 1 - R5CR7039LBJ 2 - emulator-5554 3 - emulator-5556 Select device: The adb command to be
21 Sep 2023Android has a lot of tools for developers and one that has been around for as long as I can remember is Android Debug Bridge ( adb ). It allows you to issue commands to an attached device, such as installing an app or starting an Activity . If I want to test deeplinks, for example, I can issue an adb command that simulates the system sending an Intent directed to my app: โ ~ adb shell am start -W
30 Aug 2023Of all the projects that I have worked on over the years, one thing they all have in common is the need to pass things around. Whether passing stuff to an Activity as Intent extras, a Fragment as arguments or its onSaveInstanceState , or even a ViewModel โs SavedStateHandle , the most common way to do it is through a Bundle . An Activity can accept different types of data through the various putEx
21 Aug 2023It has been a hot minute since I posted about writing multi-module Lint rules so itโs time for a follow up. Todayโs topic: suppressions! A quick recap of where we are: We have written a Lint rule that checks for usages of deprecated colours (including selectors) in XML files. The rule goes through all modules in the project looking for colours that are contained in any file with the _deprecated su
15 Feb 2022I have been working with deeplinks lately and I noticed that quite a few things have changed since I last worked with them. The most important change is quoted in the list of Android 12 behaviour changes : Starting in Android 12 (API level 31), a generic web intent resolves to an activity in your app only if your app is approved for the specific domain contained in that web intent. If your app isn
8 Feb 2022