Skip to content
tezvyn:

Android & Kotlin

Jetpack Compose, Android Studio, Kotlin, Material You

157 bites

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

Concepts in Android & Kotlin, page 5

Scoped Storage: Your App's Private File Cabinet
intermediate2 min read

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.

Room: Querying Relational Data Without Manual Joins
advanced2 min read

Room: Querying Relational Data Without Manual Joins

Room lets you query related objects without writing raw SQL joins, mapping one-to-many or many-to-many relationships into nested objects. This is key for fetching a user and their posts in one go.

Testing Room Databases: On-Device vs. Local JVM
advanced2 min read

Testing Room Databases: On-Device vs. Local JVM

Test your Room database in two ways: on an Android device for realism, or on your local JVM for speed. This is crucial for verifying DAO queries and preventing data bugs. The footgun is assuming local tests behave identically to on-device tests.

advanced2 min read

FileProvider: Securely Share Files Between Apps

FileProvider is Android's bouncer for files, replacing insecure file:/// URIs with temporary, permission-granted content:// URIs. Use it to send a photo for editing or attach a PDF to an email.

easy2 min read

REST: The Architectural Style for Web APIs

REST is the architectural style for web APIs, using standard HTTP methods like GET and POST to manage data. Your Android app uses it to fetch user profiles from a server. The footgun is treating REST as a strict protocol; it's a set of guidelines.

easy2 min read

Retrofit: Turn Your HTTP API into an Interface

Retrofit turns your HTTP API into a simple interface, letting you define network calls as annotated methods. It's the standard for most Android network tasks. Footgun: forgetting to run calls off the main thread will crash your app.

Kotlinx.serialization: Kotlin's Native Data Converter
easy2 min read

Kotlinx.serialization: Kotlin's Native Data Converter

Kotlinx.serialization is Kotlin's native way to convert data classes into formats like JSON. It uses a compiler plugin to automate the process, making it ideal for API calls or saving data.

easy2 min read

OkHttp: A Smarter HTTP Client for Your App

OkHttp is a smart, resilient HTTP client for Android and Java. It automatically handles complexities like connection pooling, caching, and GZIP compression to make requests faster and more reliable.

Handling API State with a Sealed Class Wrapper
intermediate2 min read

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.

intermediate2 min read

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.

advanced2 min read

Certificate Pinning: Trusting Only Your Own Servers

Certificate pinning hardcodes your server's public key hash into your app, rejecting any other certificate. This prevents man-in-the-middle attacks from compromised CAs. The footgun: if the server certificate changes, your app breaks until you update the pin.

advanced2 min read

OkHttp Caching: Beyond Simple Hits and Misses

OkHttp's cache acts like a browser's, saving network trips by storing responses on disk. It handles not just full hits and misses, but also validates stale data with the server. Use it for repeatable requests.

Dependency Injection: Your Objects Shouldn't Create Their Own Helpers
easy2 min read

Dependency Injection: Your Objects Shouldn't Create Their Own Helpers

Instead of creating its own helpers (like a network client), an object receives them from an outside source. This is crucial for building testable Android apps, as it lets you swap a real UserRepository with a fake one during tests.

@HiltAndroidApp: The Entry Point for Hilt DI
easy1 min read

@HiltAndroidApp: The Entry Point for Hilt DI

@HiltAndroidApp is the main power switch for Hilt dependency injection. You place it on your Application class to trigger code generation and create the top-level dependency container.

@HiltViewModel: Simplified ViewModel Injection
intermediate2 min read

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

Testing with Hilt: Swapping Dependencies for Isolation
advanced2 min read

Testing with Hilt: Swapping Dependencies for Isolation

Hilt testing swaps real app components for fakes, isolating your code under test without manual setup. It's used in UI and unit tests to replace production dependencies like network clients with test doubles.

Threads: Your App's Second Pair of Hands
easy2 min read

Threads: Your App's Second Pair of Hands

A thread is a separate path of execution for background work, keeping your app's UI responsive. It's used for long tasks like network calls or disk I/O. The main footgun is trying to update the UI from a background thread, which will crash your app.

easy2 min read

AsyncTask: The Deprecated Way to Do Background Work

AsyncTask was Android's original tool for short background tasks that update the UI. It was used for simple network requests or disk I/O. It's fully deprecated due to memory leaks and lifecycle issues; use Kotlin Coroutines instead.

easy2 min read

IntentService: Queued Background Work (Deprecated)

IntentService was a simple tool for running background tasks sequentially. You sent it work as an Intent, it processed it on a worker thread, and shut down when done. It's now deprecated; use WorkManager for modern background jobs.

intermediate2 min read

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.

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