Skip to main content
PCSalt
YouTube GitHub

# kotlin

42 posts

Automating Android Repo Maintenance with Reusable GitHub Actions

How I modernized 8 Android repos in one session — reusable CI workflows, batch build system updates, and a pattern for maintaining multiple projects at scale.

Rate Limiting & Circuit Breakers with Resilience4j

Add resilience to Spring Boot 4 services with Resilience4j — circuit breakers, retries, rate limiters, bulkheads, and how to configure them for production.

SharedPreferences in Android — The Complete Guide

Everything you need to know about SharedPreferences in Android — when to use it, how to save, read, remove, and list all stored values. All examples in Kotlin.

AlertDialog in Android — The Complete Guide

Everything you need to know about AlertDialog in Android — basic usage, selection dialogs, custom layouts, and button customization. All in Kotlin.

Spring Boot Actuator & OpenTelemetry — Production Monitoring

Set up Spring Boot Actuator for health checks and metrics, integrate OpenTelemetry for distributed tracing, and export to Prometheus and Grafana.

Spring Boot + Kafka — Producer, Consumer & Dead Letter Topics

Integrate Apache Kafka with Spring Boot 4 — producer configuration, consumer groups, error handling, dead letter topics, and JSON serialization.

Testing Spring Boot — Unit, Integration & Testcontainers

A practical guide to testing Spring Boot 4 applications — unit tests, MockMvc, @DataJpaTest, Testcontainers for PostgreSQL, and @ServiceConnection.

Spring Security — JWT Authentication from Scratch

Implement JWT authentication in Spring Boot 4 with Spring Security 7 — login endpoint, token generation, validation, refresh tokens, and protected routes.

Spring Data JPA with PostgreSQL — Repository Pattern Done Right

Set up Spring Data JPA with PostgreSQL in Spring Boot 4 — entities, repositories, custom queries, pagination, and database migrations with Flyway.

REST API Design in Spring Boot 4 — Validation, Error Handling & DTOs

Design production-ready REST APIs in Spring Boot 4 — request validation with Bean Validation, structured error responses, DTO patterns, and API best practices.

Spring Boot 4 Starter — Project Setup, Structure & First API

Set up a Spring Boot 4 project from scratch — project structure, REST controller, configuration, profiles, and your first working API endpoint.

Kotlin 2.x — What Changed and How to Migrate

Everything you need to know about migrating to Kotlin 2.x — the K2 compiler, breaking changes, new features, Compose compiler integration, and step-by-step migration guide.

Kotlin Testing with Kotest & MockK — Beyond JUnit

Level up your Kotlin testing — Kotest for expressive test styles and assertions, MockK for idiomatic mocking. A practical guide with real-world examples.

Kotlin Value Classes & Inline Functions — Zero-Cost Abstractions

Learn how Kotlin value classes and inline functions give you type safety and abstraction without runtime overhead — wrapping primitives, type-safe IDs, and performance patterns.

Kotlin + Arrow — Functional Error Handling (Either, Raise)

Learn functional error handling in Kotlin with Arrow — Either, Raise, typed errors, and how to replace try-catch with composable error handling.

CQRS with Spring Boot, Kafka & MongoDB — Part 5: Putting It All Together

Docker Compose setup, end-to-end flow walkthrough, integration tests with Testcontainers, and a production readiness checklist for the complete CQRS system.

CQRS with Spring Boot, Kafka & MongoDB — Part 4: The Hard Parts

Eventual consistency, idempotent consumers, schema evolution, the outbox problem — the real-world challenges that make CQRS hard and how to handle them.

CQRS with Spring Boot, Kafka & MongoDB — Part 3: Query Side — Reads at Scale

Building the query service — consuming Kafka events, building read-optimized projections, and serving fast queries from MongoDB.

Kotlin Context Receivers & Scope Functions Deep Dive

Master Kotlin's scope functions (let, run, with, apply, also) and understand context receivers — when to use each, common patterns, and real-world examples.

CQRS with Spring Boot, Kafka & MongoDB — Part 2: Command Side — Writes Done Right

Building the command service — accepting orders, validating business rules, persisting to MongoDB, and publishing domain events to Kafka.

CQRS with Spring Boot, Kafka & MongoDB — Part 1: What is CQRS and why you need it

Understanding Command Query Responsibility Segregation, when it makes sense, and how Spring Boot, Kafka, and MongoDB fit together in a CQRS architecture.

Kotlin + Ktor — Building a REST API Without Spring

Build a REST API with Ktor 3 and Kotlin — routing, serialization, authentication, database access, and testing. A lightweight alternative to Spring Boot.

Kotlin Multiplatform — Share Code Between Android & Backend

A practical guide to Kotlin Multiplatform (KMP) — share business logic, models, and validation between your Android app and Spring Boot backend without duplicating code.

Kotlin DSL — Build Your Own Type-Safe Builder

Learn how to create type-safe DSLs in Kotlin using lambdas with receivers, extension functions, and builder patterns. Build a real HTML DSL and a config DSL from scratch.

Kotlin Sealed Classes & When Expressions — Modeling State

Learn how Kotlin sealed classes and when expressions work together to model state, handle API responses, and eliminate impossible states in your code.

Kotlin Flows — Cold Flows, Hot Flows & StateFlow Explained

Understand Kotlin Flow from the ground up — cold vs hot flows, Flow builders, operators, StateFlow, SharedFlow, and when to use each in Android and backend projects.

5 Kotlin Extension Functions You'll Use in Every Android Project

Practical Kotlin extension functions for Android — view visibility, toasts, keyboard handling, dp conversion, and intent helpers. Copy, paste, use.

Kotlin Coroutines — Part 3: Real-World Patterns

Flows, StateFlow, coroutines in Android and Spring Boot, Retrofit, Room, and testing — practical patterns you'll use every day.

Kotlin Coroutines — Part 2: Structured Concurrency

How structured concurrency keeps your coroutines under control — scopes, cancellation, exception handling, and the parent-child relationship that prevents orphan coroutines.

Kotlin Coroutines — Part 1: The Basics

A practical introduction to Kotlin coroutines — why they exist, how to launch them, suspend functions, dispatchers, and concurrent execution patterns.

JSON Parsing in Kotlin — Parsing with Kotlin Serialization

Parse a complex JSON response using Kotlin Serialization — the Kotlin-native, compile-time safe approach with no reflection.

CI/CD for Android with GitHub Actions

Set up automated builds, tests, signing, and Play Store deployment for your Android project using GitHub Actions.

XML Parsing in Kotlin — XmlPullParser and Retrofit

Parse XML in Kotlin using Android's built-in XmlPullParser and Retrofit with SimpleXML converter. Manual vs automatic — when to use what.

JSON Parsing in Kotlin — Which Library Should You Use?

A side-by-side comparison of org.json, Gson, Moshi, Kotlin Serialization, and Jackson for JSON parsing in Kotlin.

JSON Parsing in Kotlin — Parsing with Jackson

Parse a complex JSON response using Jackson with the Kotlin module — the server-side powerhouse that's also the default in Spring Boot.

JSON Parsing in Kotlin — Parsing with Moshi

Parse a complex JSON response using Moshi with Kotlin data classes, codegen, and proper null safety. The recommended JSON library for modern Android.

JSON Parsing in Kotlin — Parsing with Gson

Parse a complex JSON response using Gson with Kotlin data classes. Automatic mapping, @SerializedName, nullable types, and a custom TypeAdapter for Instant.

JSON Parsing in Kotlin — Manual Parsing with org.json

Parse a complex, real-world JSON response manually using org.json in Kotlin. Extension functions help, but the verbosity is still real.

Add Badge Count to Navigation Drawer Hamburger Icon

NavigationDrawer provides easy access to menu functions. Sometimes the menu items have some actionable content available. To notify user that...

Migrate to Android Room with Date Column

Migrating our apps to Android Room from conventional SQLite Database was flawless except when we encountered issue with Date column...

Find and Delete Duplicate Files — Kotlin CLI Tool

A command-line utility in Kotlin that scans directories for duplicate files using MD5 hashing and lets you review and delete them safely.

Copy to Clipboard Programmatically

Copy text to clipboard and paste from clipboard programmatically in Android using ClipboardManager and ClipData.