Skip to content
tezvyn:

Android

433 bites tagged Android — interview questions with model answers, and 60-second explainers.

Android & Kotlin2 min read

Android Build Variants: One Codebase, Many Apps

Think of build variants as a matrix for your app builds, combining build types (like debug/release) with product flavors (like free/paid). This lets you manage different API endpoints or features for various versions from a single codebase.

Android & Kotlin2 min read

Adding Build Dependencies with Gradle in Android

Gradle is the tool for adding build dependencies to your Android app. This allows you to integrate external libraries like Jetpack, Compose, or Google Play Services, which are essential for building modern applications.

Android & Kotlin2 min read

Logcat: The `tail -f` for Android Apps

Think of Logcat as `tail -f` for your Android app, streaming system and application messages from a device in real-time. It's your primary tool for debugging crashes, tracking execution flow, and inspecting variable values as your app runs.

Android & Kotlin2 min read

Android App Development: Core Languages and Tools

Android apps are primarily built with Kotlin, Java, and C++ using the official SDK. While other languages are possible, they often need 'glue' code to work and may have restricted API access. The main footgun is assuming any language has first-class support.

Android & Kotlin2 min read

AndroidManifest.xml: The Blueprint for Your App

AndroidManifest.xml is the blueprint for your app, telling the OS its components, permissions, and requirements before running any code. A missing declaration here is a common source of runtime crashes, as the OS simply won't see your component.

Android & Kotlin2 min read

Android Project Structure: Your App's Filing Cabinet

Think of an Android project as a standardized filing cabinet. It organizes your code, images, and configuration into specific folders so the build system knows where to find everything. This is the foundation of every Android app you build or inspect.

Android & Kotlin1 min read

Android Studio: The Official Workshop for Android Apps

Think of Android Studio as the all-in-one workshop for building Android apps. It bundles a code editor, build system, and emulators to write, test, and package software for any Android device. The footgun is underestimating its resource needs.

Android & Kotlin2 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`.

Android & Kotlin2 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.

Android & Kotlin2 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.

Android & Kotlin2 min read

Kotlin Delegated Properties: Reusing Getter/Setter Logic

Kotlin's delegated properties let you outsource a property's getter/setter logic. Instead of writing boilerplate, you reuse common patterns like lazy initialization (`by lazy`) or observing changes (`by observable`).

Android & Kotlin2 min read

StateFlow: A Hot Flow for UI State

StateFlow is a state-holder observable that emits the current and new state updates to its collectors. Use it to expose UI state from a ViewModel to a UI. The footgun: slow collectors can miss intermediate state updates, receiving only the most recent value.

Android & Kotlin2 min read

Kotlin Coroutines: async/await for Parallel Results

async starts a coroutine for a parallel result, returning a `Deferred` value. `await` pauses until that result is ready. Use it to run independent network calls concurrently. The footgun: using it for sequential tasks creates a needless race condition.

Android & Kotlin2 min read

Structured Concurrency in Kotlin

Structured concurrency treats async operations like code blocks: a parent task's lifetime contains its children. In Kotlin, a `CoroutineScope` ensures if the parent is cancelled, all its child coroutines are too.

Android & Kotlin2 min read

Kotlin Flow: Asynchronous Data Streams

A Kotlin Flow is like an async Sequence, emitting multiple values over time without blocking. It's used for live data from a database or streaming network responses. The footgun: Flows are cold; the code doesn't run until a collector calls `.collect()`.

Android & Kotlin2 min read

CoroutineScope: The Parent of Your Coroutines

A CoroutineScope acts as a parent to a group of coroutines, managing their lifecycles. When the parent scope is cancelled, all its children are cancelled too. It's used with builders like `launch` to group related work, like in an Android ViewModel.

Android & Kotlin2 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.

Android & Kotlin2 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.

Android & Kotlin2 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.

Android & Kotlin2 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`.

Android & Kotlin2 min read

Kotlin Data Classes: Automatic Boilerplate for Data Holders

A Kotlin `data class` automatically generates boilerplate like `equals()` and `toString()` for classes that just hold data. Use it for model objects or DTOs where value equality matters. The footgun: its `copy()` method is shallow, sharing mutable objects.

Android & Kotlin2 min read

Kotlin Inheritance: Open for Extension, Closed by Default

In Kotlin, classes are final by default. Think of inheritance as an opt-in feature you enable with the `open` keyword. Use it to create specialized versions of a base class, like a `Student` from a `Person`.

Android & Kotlin2 min read

Kotlin Functions: Named, Reusable Code Blocks

A function is a named recipe for your code. You give it ingredients (parameters) and it produces a result. They are used everywhere, from calculating values to handling button clicks.

Android & Kotlin2 min read

Kotlin Null Safety: Catch Nulls at Compile Time

Kotlin's type system catches null pointer errors at compile time. Variables are non-nullable by default; you must opt-in to nulls with a `?` (e.g., `String?`). The compiler then forces you to handle the null case. The main footgun is the `!!` operator.

Get Android bites daily.

Five a day, five minutes, offline. With quizzes so it sticks.

Open testing — you’ll join as an early tester.