RSSAmplifier

Blog

zsmb.co

Recent content on zsmb.co

zsmb.coRSS feed ↗63 posts

Latest posts

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.

How I Finally Memorized Modifier Ordering in Compose

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.

Building a macOS screen saver in Kotlin

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.

The conflation problem of testing StateFlows

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.

Celebrating 5 years of Kotlin on Android

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.

5 years of Kotlin on Android — the extended interviews

Interview material for the 5 years of Kotlin on Android celebration that did not make it into the main blog post.

Migrating to the new coroutines 1.6 test APIs

See the steps we took to migrate our samples to the new APIs, and then get started on migrating your own project!

Wrap-up 2021

Another year over, a new one's almost begun. Here's a brief summary of what I've done in this one.

Adventures in Tracking Upload Progress With OkHttp and Retrofit

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.

All About Opt-In Annotations

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.

A Bit of Gradle Housekeeping

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.

Keeping public API in check with the Kotlin binary validator plugin

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.

Announcing requireKTX

Introducing a new library to conveniently require values from common Android types.

Clean Chat Example App with Jetpack Compose

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!

Pi Practice App in Compose

In another detailed Jetpack Compose walkthrough, we'll look at implementing a simple app for practicing the digits of pi!

Prime Table Generator in Jetpack Compose

I've dusted off one of my oldest (and favourite) coding projects, and rewrote it in Jetpack Compose as a nice little practice exercise.

Build an Android Chat app with Jetpack Compose

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: First Impressions and Learning Resources

Jetpack Compose is finally in beta. Here are my first impressions using its beta, and some recommended resources for getting started with it.

Compose O'Clock

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.

Publishing Android libraries to MavenCentral in 2021

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.

Sealed goodies coming in Kotlin 1.5

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!

Wrap-up 2020

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.

Mastering API Visibility in Kotlin

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.

Effective Class Delegation

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.

Krate, a better SharedPreferences experience

Accessing SharedPreferences using its API directly can be somewhat inconvenient. Krate is a library built on Kotlin delegates to simplify the use of SharedPreferences.

Introducing 🌈RainbowCake

RainbowCake is an Android architecture framework, providing tools and guidance for building modern Android applications.

Fragment Lifecycles in the Age of Jetpack

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.

Thoughts about Event Handling on Android

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.

Thoughts about State Handling on Android

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.

Designing and Working with Single View States on Android

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.

The Single-cable Dream

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.

Anecdotes about web APIs

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.

Coroutine Cancellation 101

A brief introduction to the basics of coroutine cancellation.

Let's Review: Pokedex

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?

Wrap-up 2019

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.

Getting Only Positive Feedback

A brief discussion of my wonderful imposter syndrome and a call for more criticism (at least towards me).

Better Custom Views with Delegates

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.

Book (P)review: Living by the Code

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.

Publishing an Android library to MavenCentral in 2019

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.

Primaries Matter (a discussion of constructors)

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.

The Dog Riddle

A fun little challenge in Kotlin API design. Give it a try!

Delightful Delegate Design

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.

Maintaining Compatibility in Kotlin Libraries

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 Deep Dive into Extensible State Saving

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.

An Early Look at ViewModel SavedState

A quick preview of the new SavedState support for Android Architecture Component ViewModels.

Site History

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.

Managing Git configurations

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.

@JvmOverloads for Android Views

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 meets coroutines

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 aren't (that) magical

Data classes are great, but don't underestimate what a regular Kotlin class can do on its own.