Skip to content
tezvyn:

Android & Kotlin

Jetpack Compose, Android Studio, Kotlin, Material You

38 bites

Test yourself: Top 30 advanced Android & Kotlin concepts questionsMultiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Advanced concepts in Android & Kotlin

Kotlin Extension Functions: Add Methods Without Inheritance
advanced2 min read

Kotlin Extension Functions: Add Methods Without Inheritance

Kotlin extension functions let you add new functionality to existing classes without inheritance, as if you were adding a new method. They're perfect for creating helpers for third-party library classes or framework types like String.

Kotlin Scope Functions: Cleaner Code, Clearer Choices
advanced2 min read

Kotlin Scope Functions: Cleaner Code, Clearer Choices

Kotlin's scope functions (let, run, apply) create a temporary workspace for an object, avoiding repetitive variable names. Use them for object configuration or chaining calls.

Kotlin Sealed Classes: Enums for Types
advanced2 min read

Kotlin Sealed Classes: Enums for Types

A sealed class is like an enum, but for types. It defines a closed set of subclasses, letting each one carry different data. It's perfect for modeling states like Loading, Success, and Error, ensuring you handle every case at compile time.

Kotlin Coroutines on Android
advanced2 min read

Kotlin Coroutines on Android

Kotlin coroutines let Android code write asynchronous logic that reads like sequential code, suspending instead of blocking a thread. Structured concurrency ties each coroutine to a scope, so a destroyed ViewModel cancels its children automatically.

Coroutine Exception Handling: launch vs. async
advanced2 min read

Coroutine Exception Handling: launch vs. async

Coroutine builders handle exceptions differently. launch propagates them immediately, crashing if unhandled. async silently catches them, waiting for you to call await. Use a CoroutineExceptionHandler on root scopes for global logging.

SharedFlow: A Hot Flow for Broadcasting Events
advanced2 min read

SharedFlow: A Hot Flow for Broadcasting Events

A SharedFlow is a hot stream that broadcasts values to all subscribers, like a live TV channel. It's ideal for one-to-many events, like UI updates or notifications. The main footgun: it never completes, so collect will suspend forever.

Kotlin's `in` and `out`: Declaration-Site Variance
advanced2 min read

Kotlin's `in` and `out`: Declaration-Site Variance

Kotlin's out and in keywords define a generic class as a producer or consumer at its declaration, avoiding Java's repetitive wildcards. Use out T for types only returned (produced) and in T for types only consumed.

Reified Type Parameters: Accessing Generic Types at Runtime
advanced2 min read

Reified Type Parameters: Accessing Generic Types at Runtime

Reified type parameters let you access generic types at runtime, bypassing JVM type erasure. In Kotlin, you use this inside inline functions to check types (obj is T) or get a class reference. The footgun: reified requires inline to work.

Kotlin's Type-Safe Builders: Code as Data
advanced2 min read

Kotlin's Type-Safe Builders: Code as Data

Type-safe builders use Kotlin code to create a custom language (DSL) for building complex objects. It's like writing HTML, but the compiler validates your structure. This is common for UI layouts or server configs. The footgun is omitting @DslMarker.

advanced1 min read

Android Gradle Plugin (AGP): The Engine of Your Android Build

The Android Gradle Plugin (AGP) is the specialized toolkit that teaches Gradle how to build, test, and package Android apps. It's used in every project to handle tasks like compiling resources and signing your app.

Android Studio Profiler: Find Your App's Bottlenecks
advanced2 min read

Android Studio Profiler: Find Your App's Bottlenecks

The Android Studio Profiler is your app's diagnostic dashboard, showing real-time CPU, memory, and network usage. Use it to hunt down UI jank, find memory leaks, and optimize battery-draining network calls.

Layout Inspector: Debug Your UI Hierarchy
advanced2 min read

Layout Inspector: Debug Your UI Hierarchy

Layout Inspector is an X-ray for your app's UI, rendering a live 3D model of your component tree. Use it to debug visual glitches or find performance bottlenecks from deep layouts. The footgun is forgetting it has live updates to catch bugs during animations.

R8: Shrinking and Obfuscating Android Code
advanced2 min read

R8: Shrinking and Obfuscating Android Code

R8 is a compile-time tool that shrinks and obfuscates your Android app. It removes unused code and renames classes to reduce APK size and deter reverse-engineering.

Android Foreground Services: Work the User Can See
advanced2 min read

Android Foreground Services: Work the User Can See

A foreground service tells Android, "Don't kill this process; the user knows it's running." It's a contract for long-running work made visible by a persistent notification, used for music playback or navigation.

WorkManager: Guaranteed, Deferrable Background Work
advanced2 min read

WorkManager: Guaranteed, Deferrable Background Work

WorkManager is Android's smart to-do list for background tasks. It guarantees execution for deferrable work, like syncing data, even if the app closes or the device reboots. The footgun is using it for immediate tasks; it prioritizes system health over speed.

Data Binding: Link Android UI to Data in XML
advanced2 min read

Data Binding: Link Android UI to Data in XML

Data Binding lets you connect UI components to data sources directly in XML, eliminating manual findViewById calls. It's used to set view properties based on your ViewModel's state.

advanced2 min read

MotionLayout: Animate Layouts with States, Not Code

MotionLayout animates layouts by describing start and end states in XML, letting the system handle the transition. Use it for complex UI choreography, like a collapsing toolbar, or to link animation progress to a user's swipe.

Android View Animation: A Blueprint for Motion
advanced2 min read

Android View Animation: A Blueprint for Motion

Think of Android's view-based animations as a pre-written score. You define the animation (the "score") in an XML file, then apply it to a View (the "instrument") in your code. This is used for animating properties like alpha or translation on UI elements.

Compose Side-Effects: Escaping the Pure Function
advanced2 min read

Compose Side-Effects: Escaping the Pure Function

Compose functions should be pure, but apps must interact with the world. Side-effect APIs are controlled escape hatches to run non-UI code, like network calls or showing Toasts, from within a composable's lifecycle. The footgun is calling this logic directly.

CompositionLocal: Implicitly Pass Data Down the UI Tree
advanced2 min read

CompositionLocal: Implicitly Pass Data Down the UI Tree

CompositionLocal is like CSS inheritance for your UI tree, letting you pass data down implicitly without parameter drilling. It's ideal for ambient data like theming or localization. The footgun is overusing it, which makes components harder to test.

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles