Setting up Compose Multiplatform previews
Compose Multiplatform now has support for previews in common code. Here's how you can get started with using them.
Recent content on zsmb.co
Compose Multiplatform now has support for previews in common code. Here's how you can get started with using them.
For the longest time, I proudly had no idea of how Modifier ordering works, and would just guess and then guess again when something didn't look quite right. Here's how I finally ended up remembering how the ordering works.
This article documents how I created my own custom screen saver for macOS, built almost entirely in Kotlin, using the powers of Kotlin Multiplatform compiled to macOS. Join me for a tale of Kotlin success and macOS failures.
StateFlow behaves as a state holder and a Flow of values at the same time. Due to conflation, a collector of a StateFlow might not receive all values that it holds over time. This article covers what that means for your tests.
Five years ago, at the 2017 Google I/O Keynote, Kotlin became an officially supported language for Android development. With this post, let's celebrate by revisiting that initial story, some important steps along the way, and by looking at the ongoing efforts by Google to support Kotlin.
Interview material for the 5 years of Kotlin on Android celebration that did not make it into the main blog post.
See the steps we took to migrate our samples to the new APIs, and then get started on migrating your own project!
Another year over, a new one's almost begun. Here's a brief summary of what I've done in this one.
Tracking file upload progress can have some unexpected complexities. This article tells the story of how we refined our implementation of this feature in the Stream Chat Android SDK.
Have you ever encountered APIs that show warnings or errors when you use them, saying that they're internal or experimental? In this guide, you'll learn everything you need to know about opt-in APIs in Kotlin: how to create and use them, and all their nuances.
While cleaning is traditionally a spring activity, let me invite you to do it at the end of summer this time around. In this article, we'll take a look at some Gradle configuration that you can probably clean up in your Android project.
As your library code is evolving over time, you have to be mindful of changes in your public API. Here’s how you can keep it in check.
Introducing a new library to conveniently require values from common Android types.
Jetpack Compose makes it easy to build beautiful UI. Check out this Chat UI sample, and learn some exciting bits of Compose along the way!
In another detailed Jetpack Compose walkthrough, we'll look at implementing a simple app for practicing the digits of pi!
I've dusted off one of my oldest (and favourite) coding projects, and rewrote it in Jetpack Compose as a nice little practice exercise.
In this tutorial, you'll learn how to build a real, functional chat app using Jetpack Compose and the Stream Chat Android SDK.
Jetpack Compose is finally in beta. Here are my first impressions using its beta, and some recommended resources for getting started with it.
I started learning Jetpack Compose this week. Two days into that adventure, here's a quick look at how a neat clock design can be built up in Compose, step-by-step.
MavenCentral is the place to be for Android libraries, but publishing there is no easy task. With JCenter going away soon, this problem is more timely than ever. Here's the step-by-step guide on how to do it.
Kotlin 1.5 will bring exciting new features, among them improvements to sealed classes and an introduction of sealed interfaces. Let's take a look at what that will look like!
Let's send this one off so that we can get started on a better one. The "usual" recap of what I've done this year.
When designing a library, minimizing your API surface - the types, methods, properties, and functions you expose to the outside world - is a great idea. This doesn't apply to just libraries: it's a consideration you should make for every module in a multi-module project.
One of the most significant items of the Effective Java book is Item 18: Favor composition over inheritance. Let's see how Kotlin promotes this with class delegation.
Accessing SharedPreferences using its API directly can be somewhat inconvenient. Krate is a library built on Kotlin delegates to simplify the use of SharedPreferences.
RainbowCake is an Android architecture framework, providing tools and guidance for building modern Android applications.
Fragments have... Complicated lifecycles, to say the least. Let's take a look at these, and how they all fit into the world of Jetpack today, with LifecycleOwners, LiveData, and coroutines.
In MVVM-like view architectures, view state isn't enough to communicate from the ViewModel to the View. They have to be supplemented by some kind of events, which come with several challenges you should be aware of.
Handling the state of UI correctly is one of the prominent challenges of Android apps. Here are my subjective thoughts about some different approaches, which ones I tend to choose, and why.
Describing the state of a screen is a common practice these days thanks to MVI popularizing the concept. Let's take a look at some examples of how you can design your state objects neatly using data classes and sealed classes, and how you can put them into practice.
Here's the story of how I moved my entire desk setup to be attachable to a computer via a single Thunderbolt 3 cable. It was quite the adventure, and 100% worth it.
I think any respectable service these days should offer a web API to paying customers, so that power users of the service can integrate it with other services, and have reliable, trustworthy programmatic access to their data. Here are some anecdotes about services and APIs.
A brief introduction to the basics of coroutine cancellation.
In what may be the start of a new series, I code review a project that was posted on reddit recently and got very popular very quickly. Let's see what we can learn from it?
Another year has come to an end, so it's time to reflect again. I'll attempt to sum up what I've done this year, how that compares to what I was planning to do at this same time last year, and what I expect to be next.
A brief discussion of my wonderful imposter syndrome and a call for more criticism (at least towards me).
Reusable UI components are all the rage these days. In this article, we'll take a look at implementing custom components easily by using Kotlin's delegates.
I can't tell you how much I've been anticipating this book ever since I first heard it announced. This is a very short review, because really, you should read it yourself. But let me spoil one thing: It's amazing.
MavenCental is the place to be for serious libraries, but setting up publication to it can be a truly daunting task. Here's the guide to how we do it.
Primary constructors play a fundamental role in Kotlin classes. Let's take a close look at them, and really understand what exactly is part of a primary constructor, and what makes this constructor so special.
A fun little challenge in Kotlin API design. Give it a try!
When developing a library, designing an easy to use API while hiding unnecessary implementation details from clients is fundamental. Let's look at some API design choices we've made for our library Krate, an Android SharedPreferences wrapper.
Not breaking client code is an essential duty of a library developer. Let's take a look at a couple rarely discussed issues you might face in this area.
A perhaps overly thorough look at how extensible state saving is implemented in the AndroidX libraries, and how ViewModel state saving specifically is hooked into this system.
A quick preview of the new SavedState support for Android Architecture Component ViewModels.
There has been a website of some sorts up on this domain for a couple years now. Here's a history of what powered it at various times.
We all use different git configurations for various reasons, and it's easy to get them mixed up. Here's a look at some ways of managing them better.
The @JvmOverloads annotation is a convenience feature in Kotlin for interoperating with Java code, but there is one specific use case on Android where it shouldn’t be used carelessly.
Retrofit's coroutine support has been a long time coming, and it's finally coming to completion. Take a look at how you can use it to neatly integrate networking into an application built with coroutines.
Data classes are great, but don't underestimate what a regular Kotlin class can do on its own.