Intermediate concepts in Android & Kotlin, page 2

Recomposition: Smart UI Updates in Compose
Recomposition is how Compose redraws your UI. It intelligently re-runs only the functions whose state has changed, avoiding a full screen refresh. This is triggered automatically when a State object that a composable reads is updated.

Lazy Layouts: Compose's Answer to Efficient Lists
Lazy layouts in Jetpack Compose render only the list items visible on screen, avoiding memory crashes from large datasets. Use them for long lists like feeds or galleries, but remember to provide a key to prevent UI glitches when data changes.

Theming in Compose: Style from a Single Source
Theming in Compose is like a CSS stylesheet for your app. You define colors, typography, and shapes once in a central Theme composable, and it cascades down. Use it for light/dark modes and brand consistency.

Navigation in Compose
Navigation in Compose treats screens as state. You define a graph of composables, each with a string 'route', and navigate by changing the current route. It's ideal for single-activity apps.

Using Android Views in Compose (and Vice Versa)
AndroidView and ComposeView are bridges for gradual UI migration. Use them to embed classic Views in Compose screens or vice versa, like for a MapView. The footgun is managing state and lifecycles across the two different UI paradigms, which can lead to bugs.

Repository Pattern: Your App's Single Source of Truth
The Repository Pattern acts as a mediator for your app's data, fetching from sources like a network or database. Use it to separate your UI from data-fetching logic, like caching. The footgun is putting business logic here; it's for data operations only.

Room Type Converters: Teach Your Database New Tricks
Room Type Converters are translators for your database, teaching it to store types it doesn't natively understand, like Date. They let you persist simple objects by converting them to primitives like Long. The footgun is faking object relations with them.

Room Database Migrations: Evolving Your Schema Safely
A Room migration is a renovation plan for your database. When you change your schema, you provide SQL instructions to upgrade existing user data without loss, preventing crashes on app updates. The footgun is forgetting to increment the database version.

App-Specific Storage: Your App's Private Locker
Think of app-specific storage as a private locker for your app's data, automatically cleaned up on uninstall. Use it for cache, settings, or internal data. The footgun: assuming this data is permanent—it's deleted when the user uninstalls.

Scoped Storage: Your App's Private File Cabinet
Scoped Storage gives your app a private file cabinet on external storage, not a key to the whole building. It's the default on modern Android for saving data or accessing media. The footgun: don't use direct file paths to shared files; you must use new.

Handling API State with a Sealed Class Wrapper
Treat API calls as states, not just data. A sealed class wrapper (Success, Error, Loading) models these states for your UI. Use this with Retrofit to show spinners or errors without crashing. The footgun: don't scatter try-catch blocks; centralize them.
Moshi: Modern JSON for Kotlin & Android
Moshi is a modern JSON library that maps JSON strings to your Kotlin/Java objects. It's a translator between API text and your app's data classes, built with Kotlin-first features. The footgun: Kotlin classes require Moshi's codegen or reflection adapter.

@HiltViewModel: Simplified ViewModel Injection
@HiltViewModel automates creating ViewModels with dependencies. Instead of writing custom factories, just annotate the ViewModel and its constructor. It's the standard for injecting dependencies like repositories into ViewModels in a Hilt-powered Android app.
AlarmManager: Scheduling Precise Future Tasks in Android
AlarmManager is Android's system-wide alarm clock for your app, letting you run code at a specific time, even if your app is closed. Use it for time-sensitive tasks like calendar notifications. The footgun: alarms are wiped on reboot and must be re-registered.

AndroidX Test: The Standard Android Testing Toolkit
AndroidX Test offers a unified API for all Android testing, from local unit tests to on-device UI automation. It's the standard for building robust, testable apps. The footgun: accidentally bundling test-only dependencies into your production APK.
ActivityScenario: Test Your Android Activities in Isolation
ActivityScenario lets you launch and control an Android Activity's lifecycle within an instrumented test. Use it to verify UI behavior during events like screen rotation or process death, isolating the component for reliable testing.

Robolectric: Run Android Unit Tests on the JVM
Robolectric runs Android unit tests on a regular JVM, not a slow emulator. Use it in CI/TDD to test logic like Activity lifecycles without the minutes-long build-deploy cycle. The footgun is over-mocking; Robolectric tests behavior, not just implementation.

Espresso for Android UI Testing
Espresso is an Android framework for automated UI tests. As an instrumented test, it runs on a device or emulator to simulate user interactions, helping you verify app behavior and UI correctness as part of a complete testing strategy.

Android App Startup: From Cold to Hot
App startup has three types: cold, warm, and hot. Optimization focuses on the cold start—when the app launches from scratch. This is critical for user retention, as slow launches are a common reason for uninstalls. The footgun: don't just test warm starts.

Android Keystore System
The Android Keystore System stores cryptographic keys in hardware backed secure storage instead of app memory or disk. Apps can use the keys to sign or encrypt data, but the raw key material never leaves the secure environment, even on a rooted device.
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