Advanced everything in Android & Kotlin, page 6

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.

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.

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.

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.
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.

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.

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 `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.

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 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.

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 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 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.
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