Update (February 25, 2026): The scroll indicator API described in this post was reverted in Compose Foundation 1.11.0-alpha06 . According to the changelog, the revert was because of API Council feedback, so we’ll likely get a new version of the API before long. In the meantime, this article still applies to Foundation 1.11.0-alpha01 through alpha05, and the concepts might carry over when the…
If your Jetpack Compose app supports light and dark themes, you’ve probably noticed the default behavior: a sudden cut between color schemes when the system UI mode changes. I think we’ve all seen theme changes that look like this: Your browser does not support the video tag. We can do better. By wrapping your theme setup with some animation, we can achieve smooth transitions between light…
If you’ve been working with Android for any amount of time, you’ve probably run into APIs that expose their results using callbacks or listeners. Whether it’s something like LocationManager , a custom SDK, or a third-party service like Firebase, you’re often stuck adapting old-school async patterns into your modern reactive code. This approach is especially helpful in apps…
As Android applications grow in complexity, maintaining a robust testing strategy becomes increasingly challenging. The “Robot Testing Pattern” offers a structured approach to UI testing that can significantly improve your test suite’s maintainability and reliability. This guide is designed for Android developers who have basic experience with testing and want to enhance their…
SharedPreferences has long been a staple for storing small pieces of data and user preferences in Android apps. However, it has notable limitations, such as a lack of type safety, no support for safe schema evolution, and potential performance issues on the main thread. Google introduced Proto DataStore as a modern and robust alternative, offering: Strong typing with Protocol Buffers Safe schema…
Ktlint is a powerful linting tool for Kotlin code that helps maintain code quality and consistency. While it comes with a set of built-in rules, there may be cases where you want to create custom rules tailored to your project’s specific requirements. In this tutorial, we’ll walk you through the process of writing a custom ktlint rule that detects and removes Android Log statements…
Modern Android development often involves modularization to enhance build performance and maintainability. As you break down your app into multiple modules, sharing test utilities such as fixtures, mocks, or fakes between modules can become challenging. A few years ago I wrote about the concept of test fixtures, but at the time they weren’t supported for Android modules. Thankfully, with…
Tracking how users install your app can be tricky, especially when you want to measure the effectiveness of your campaigns or ads. That’s where the Google Play Install Referrer API comes in handy—it gives you reliable data about how users found your app. If you’re developing an Android application, this guide will walk you through how to set up and use the InstallReferrerClient with Kotlin’s…
Kotlin Multiplatform (KMP) offers a powerful way to share code across platforms like Android, iOS, and the JVM. However, when it comes to testing, you might encounter a common challenge: how to handle test resources such as JSON files, configurations, or other data needed for tests. In this post, we’ll dive into strategies for accessing test resources in KMP projects. Why Test Resources Matter…
A long, long time ago, I wrote a blog post about how I was using Flipper as one of my favorite development tools. Since then, Android Studio has come a long way adding tons of features like a new Logcat and Layout Inspector . However, there are often times that you’ll need a tool more specific to your own workflow that Android Studio doesn’t provide, and that’s exactly where…
Late last year, Google announced the Android Developer Challenge , a contest for Android developers to show off new experiences made possible by on-device Machine Learning. Since then, tons of developers have submitted their ideas and been hard at work developing their apps. Today, the winners of the challenge have been announced ! I was lucky to get access to a cool trial box that Google sent…
Some time last year, Facebook released a new mobile debugging tool, named Flipper . It’s essentially the successor to the widely popular Stetho . Although after talking to many developers, it seems like this newer tool is relatively unknown. Like Stetho, Flipper has many built-in features – including a layout inspector, a database inspector and a network inspector. Unlike Stetho…
Recently, I was doing some code cleanup and noticed that there were some data in the database that was no longer needed. I think most developers clean up their codebase of deprecated patterns and unused code, but I personally have not done a good job of ensuring that the same cleanup happens for unused columns in my databases. Dropping tables that are no longer used is pretty easy (especially if…
It seems like nowadays, the best advice is to modularize your Android app . It’s a great suggestion for many reasons, including but not limited to: - improved build performance - enables on-demand delivery - pushes you to build reusable, discrete components Sounds great, right? Are there any downsides? There is one in particular which has been a a pain point for many. Often times when…
Today Google released their alpha of ViewPager2 , a signal of the nail in the coffin for the original ViewPager, originally released in 2011 ! Since then, I think it’s safe to say that most developers have needed to make a ViewPager. Despite how prolific it is, it certainly isn’t the most straightforward widget to include. I think we all have at least once wondered whether we should…
If you’re like me, you loved the Night Mode feature that was added to the Nougat Developer Preview a few months ago. You might have been disappointed when you found out that it was missing in later preview builds, and was probably going to be removed because it wasn’t ready . When the source code for Nougat was released this morning, my friend Vishnu found this interesting snippet in…
If you want to integrate your Android app with most of Google Play Services nowadays, you’ll find that you are instructed to set up the Google Services Gradle plugin to handle configuring dependencies. The plugin allows you to drop a JSON file into your project, and then the plugin will do a bunch of the configuration for your project, such as handling the API keys. This is all well and…
Pssst! If you’re an Android developer, you might not have heard yet…the N Preview started today ! As part of the festivities, a new alpha version of the support libraries was released. There was no changelog that I could find, so I decided to make one. Here’s what has changed (so far) in the public API of a few of these libraries: Support-V4: diff -U 0 -N…
Unless you’ve been hiding from all the news about Android development, you’ve likely heard about Kotlin ( which hit version 1.0 on Monday !). I’ve been toying around with it lately (the Kotlin Koans are a great place to start for a beginner) and wanted to try building an app with it – that is, until I hit a few road blocks. Personally, I’m still a fan of Dagger 1 (or…
I recently attended Google’s Android Dev Summit where the Tools team presented a talk entitled Android Studio For Experts . The room was packed for the 90 minute session, where a lot of great Android Studio tips were shared. This gave me the idea of showing off some of my favorite Android Studio tips! Language Injection Ever needed to type a JSON String? Perhaps you’ve used one as a…